电子邮件验证PHP [英] Email Verification PHP

查看:165
本文介绍了电子邮件验证PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ EmailAddress = user@domain.com; 

list($ User,$ Domain)= explode(@,$ EmailAddress);
$ DomainExists = checkdnsrr($ Domain,'MX');
if($ DomainExists == true){
//电子邮件域存在
}
else {
//电子邮件域不存在
}

如果可以,我如何验证 $ User part?

解决方案

唯一保证的方式来确保 user@example.com 存在的是向他们发送一封带有验证链接的电子邮件。



这是另一个如何做到这一点: PHP电子邮件验证链接的最简单方法


I have the following code which (I think) will only verify the domain of the email address.

$EmailAddress = "user@domain.com";

list($User, $Domain) = explode("@", $EmailAddress);
$DomainExists = checkdnsrr($Domain, 'MX');
if($DomainExists==true){
    // Email domain exists
}
else{
    // Email domain does not exist
}

If I can, how do I verify the $User part?

解决方案

The only guaranteed way to make sure user@example.com exists is sending them an e-mail with a verification link.

Here's another post on how to do that: Easiest way for PHP email verification link

这篇关于电子邮件验证PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆