如何检查邮箱地址是否存在?使用 C#、ASP.NET
可能的重复:
如何检查电子邮件地址是否存在不发送电子邮件?
大家好,
我的 ASP.NET Web 应用程序中有电子邮件功能,电子邮件地址是从数据库中获取的。是否可以检查电子邮件地址是否确实存在。我该怎么做?..我在论坛中搜索过,Google 得到了一些相关信息,其中提到使用 VRFY、RCPT 命令...但我不明白如何使用 C# 在 .NET 中使用这些命令..有一些第三方工具,但我的客户不会购买这些工具..
我有 SMTP 邮件服务器详细信息,,??有什么办法可以实现这一点吗?
Possible Duplicate:
How to check if an email address exists without sending an email?
Hi All,
I have a email functionality in my asp.net Web Application, Email Addresses are taken from a database. Is it possible to check whether E-Mail address really exists OR not. How can I do it ?.. I have searched in forums and Google got some related info which says using VRFY, RCPT Commands... but I didn't understand how can those commands be used in .NET using C#.. There are some third party tools but my client will not buy those tools..
I have SMTP mail server details,, ?? Is there any way this can be achieved ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
唯一的方法是打开 SMTP 连接并首先尝试 VRFY,如果结果为“否”,则它不存在,但如果是“是”,则可能只是服务器不告诉,所以第二步是发送命令发送电子邮件,但在 RCPT TO 中止之后,不要发送数据命令,因为即使您中止,某些服务器实际上也可能会发送电子邮件。
如果在 RCPT TO 之后它没有抗议,您不妨尝试真实发送,因为这将是进一步测试的唯一方法,但某些服务器会接受该地址,并且稍后会失败,甚至会失败并返回一条不会出现的消息。根本无法在 SMTP 会话中检测到。
因此,您无法 100% 测试电子邮件而不实际发送到该地址,并让收件人将电子邮件返回给您或单击链接来确认该地址。
The only way is to open an SMTP connection and first try the VRFY, if this results in no, it does not exist, BUT if it is Yes it might only be that the server do not tell so the second step is to send the commands to send an email but after RCPT TO you abort, do not send the data command as some servers might actually send the email then even if you abort.
If it does not protest after RCPT TO you might as well try to send for real because that will then be the only way to test further, but some servers will accept the address and only fail later or even fail with a return message that will not be detected in the SMTP session at all.
So you cannot 100 % test an email without actually sending to the address and have the recipient either return the email to you or click a link to confirm the address.