检查是否存在电子邮件地址
可能重复:
如何在不发送电子邮件的情况下检查电子邮件地址是否存在
如何检查电子邮件地址是否确实存在(而不仅仅是validation)? 这些人是如何做到的: http : //www.email-unlimited.com/tools/verify-email.aspx
它似乎工作……
SMTP协议具有接收服务器上的邮箱的命令RCPT,如果该邮箱存在,则可以返回“ok”代码。 请注意,某些服务器不会这样做,以防止垃圾邮件发送者扫描有效地址。
什么电子邮件无限制做的是以下内容:
- 使用电子邮件域查找SMTP服务器
- 启动与该SMTP服务器的会话,并将命令RCPT TO发送给:
- 结束会话
如果SMTP服务器在步骤2中返回“ok”代码,则他们确定邮箱存在。
在链接中找到了这个: http : //wiki.cdyne.com/index.php/CSharp_Email_Verification
- 打开一个新的/现有的项目。
- 在解决方案资源管理器中,右键单击要添加服务的项目,然后选择“添加Web引用”。 如果未列出“添加Web引用”,请选择“添加服务引用”,然后选择“高级”,然后选择“添加Web引用”。
- 将WSDL用于电子邮件validation放在URL块中。 (例如: http ://ws.cdyne.com/emailverifyws/emailverify.asmx? wsdl )
- 将“Web引用名称”更改为更有用的内容,例如“EmailVerify”。
//Instantiate EmailVerify EmailVerify.EmailVerify ev = new EmailVerify.EmailVerify(); //Assign ReturnValues to the VerifyEmail method and pass in: email and License Key EmailVerify.ReturnValues rv = ev.VerifyEmail("info@cdyne.com", "0"); //Assign ReturnValues to the VerifyEmailWithTimeout method and pass in: email, timeout, and License Key EmailVerify.ReturnValues rvt = ev.VerifyEmailWithTimeout("info@cdyne.com", "5", "0"); //Get the response for VerifyEmail (you can choose which returns to use) Console.WriteLine(rv.ValidLicenseKey); Console.WriteLine(rv.CorrectSyntax); Console.WriteLine(rv.EmailDomainFound); Console.WriteLine(rv.EmailDisposable); Console.WriteLine(rv.DomainVerifiesEmail); Console.WriteLine(rv.DomainAcceptsMail); Console.WriteLine(rv.EmailVerified); Console.WriteLine(rv.Timeout); Console.WriteLine(rv.DomainServersDown); Console.WriteLine(rv.GoodEmail); //Get the response to VerifyEmailWithTimeout (only using chosen responses) Console.WriteLine(rvt.EmailDisposable); Console.WriteLine(rvt.DomainVerifiesEmail); Console.WriteLine(rvt.DomainAcceptsMail); Console.WriteLine(rvt.EmailVerified); Console.WriteLine(rvt.Timeout); Console.WriteLine(rvt.DomainServersDown); Console.WriteLine(rvt.GoodEmail);
您连接到处理该电子邮件的域的SMTP服务器并询问它。 更多信息:
如果您尝试该服务,您可以看到它连接到SMTP服务器并尝试向指定的电子邮件发送电子邮件。 重要的是连接到目标帐户的SMTP服务器。 有关SMTP命令,请访问http://www.yuki-onna.co.uk/email/smtp.html