<?php function smcf_validate_email($email) { $at = strrpos($email, "@"); // Make sure the at (@) sybmol exists and // it is not the first or last character if ($at && ($at < 1 || ($at + 1) == strlen($email))) return false; // Make sure there aren't multiple periods together if (preg_match("/(\.{2,})/", $email)) return false; // Break up the local and domain portions $local = substr($email, 0, $at); $domain = substr($email, $at + 1); // echo $local.'<br>'; // echo $domain.'<br>'; // Check lengths $locLen = strlen($local); $domLen = strlen($domain); if ($locLen < 1 || $locLen > 64 || $domLen < 4 || $domLen > 255) return false; // Make sure local and domain don't start with or end with a period if (preg_match("/(^\.|\.$)/", $local) || preg_match("/(^\.|\.$)/", $domain)) return false; // Check for quoted-string addresses // Since almost anything is allowed in a quoted-...