PHP verifies that the email address is correct. (1) only applicable to Mainland China (2) Only the mainstream email address is limited and mandatory. In fact, there is no need to allow registration in all mailboxes, because many people Submit fake mailboxes and use the system to send emails automatically, which will occupy a lot of resources because the recipient's address does not exist. (3) If the server supports checkdnsrr, you can
PHP verifies that the email address is correct. (1) only applicable to Mainland China (2) Only the mainstream email address is limited and mandatory. In fact, there is no need to allow registration in all mailboxes, because many people Submit fake mailboxes and use the system to send emails automatically, which will occupy a lot of resources because the recipient's address does not exist. (3) If the server supports checkdnsrr, you can
PHP verifies that the email address is correct.
(1) Applicable only to Mainland China
(2) only mainstream email addresses are limited. In fact, there is no need to allow registration in all mailboxes, because many people Submit fake mailboxes and use the system to send emails automatically, which will occupy a lot of resources because the recipient's address does not exist.
(3) If the server supports checkdnsrr, it can be used, but it is not necessary to use it if mainstream mailboxes are already limited.
(4) we recommend that you use QQ mail or 163 mail.
function CheckEmail($email) { global $dArr; $dArr = array( '163.com','126.com','sina.com','yahoo.com.cn','yahoo.com','sohu.com','yeah.net','139.com', 'tom.com','21cn.com','qq.com','foxmail.com','gmail.com','hotmail.com','263.net', 'vip.qq.com','vip.163.com','vip.sina.com','vip.sina.com.cn','vip.foxmail.com', ); if(empty($email)) return FALSE; list($e,$d) = explode('@', $email); if(!empty($e) && !empty($d)) { $d = strtolower($d); if(!in_array($d,$dArr)) return FALSE; return preg_match('/^[a-z0-9]+([\+_\-\.]?[a-z0-9]+)*/i', $e); } return FALSE; }