Php 正在验证电子邮件地址是否存在

Php 正在验证电子邮件地址是否存在,php,mysql,Php,Mysql,我是PHP的新手。我的目标是向在我的系统中注册的用户发送电子邮件 $msg= " Hi $gen./$lName, copy and paste this code in order to activate your account copy and paste this code:$num" ; $email = "$emailadd"; $name= "GoodFaith Network Marketing Inc."; $subject = "Account Activation";

我是PHP的新手。我的目标是向在我的系统中注册的用户发送电子邮件

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );
这是我的密码:

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );
$msg=“Hi$gen./$lName,复制并粘贴此代码以激活
您的帐户复制并粘贴此代码:$num”;
$email=“$emailadd”;
$name=“诚信网络营销公司”;
$subject=“账户激活”;
$message=wordwrap($msg,70);
$sender=”cjoveric@myalphaedge.com";
$mail\u header=“From:”.$name.\r\n”;
$sendmail=mail($email,$subject,$message,$mail\u header);
我可以发送电子邮件,但我的问题是我想知道用户的电子邮件地址是否存在于雅虎、GMail或其他邮件服务中

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );

有什么方法可以过滤掉无效的电子邮件吗?

没有。你所能做的最好的事情就是发送一封电子邮件,看看用户是否对此作出回应。

使用SMTP邮件,这是最好且易于使用的方法

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );

根据regex的不同,对某些用户来说,对电子邮件地址进行regex检查可能会令人沮丧。因此,我建议跳过您的正则表达式测试,只发送带有确认链接的验证电子邮件——其他任何东西都会使您的应用程序脆弱,一旦有人提出新的DNS或SMTP扩展,应用程序就会被破坏。最好在他们注意的时候处理好

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );
例如:
-需要在您的网站中填写的确认代码
-需要访问的指向您网站的链接

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );
而且,由于只需创建一封临时电子邮件以通过验证并在事后将其删除是很容易的,因此仍然无法确定该电子邮件是否存在

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );
您可以使用Google API让您的用户使用其帐户登录,而不是验证电子邮件地址。也可以以类似的方式使用OpenID。尽管如此,这也不是100%完美。但是希伊,没有什么是100%。我们都尽可能多地做自己想做的事。就这样

$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );

注:ICANN有望很快批准UNICODE域名。这将与电子邮件地址的正则表达式模式玩得很开心。

。。。并查看用户是否响应。您无法确定用户是否收到了该消息。感谢您提供的信息:)我想知道如何将此类网站免费嵌入我们的网站www.infobyip.com/verifyemailaccount.php这不是激活电子邮件的全部意义吗?
$msg= " Hi $gen./$lName,  copy and paste this code in order to activate  
your account copy and paste this code:$num" ;
$email = "$emailadd";
$name= "GoodFaith Network Marketing Inc.";
$subject = "Account Activation";
$message = wordwrap($msg,70) ;
$sender = "cjoveric@myalphaedge.com";
$mail_header="From: ".$name."<". $sender. ">\r\n";
$sendmail=mail($email, $subject,$message, $mail_header );