C# 验证电子邮件地址是否存在

发布于 2024-09-06 02:09:55 字数 159 浏览 3 评论 0原文

关于这篇关于电子邮件验证的文章

使用C#,您将如何

  1. 发出 VRFY 命令
  2. 发出 RCPT 命令

Regarding this post about email verification,

using C#, how would you

  1. issue a VRFY command
  2. issue a RCPT command

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

浸婚纱 2024-09-13 02:09:56

如果您不担心公共 SMTP 服务器对您撒谎(请查看第 2.11 节: https://www.rfc-editor.org/rfc/rfc2505),那么最好的方法实际上可能是向服务器打开 TcpClient 并自己运行 SMTP 协议。 SMTP 是一个非常非常简单的协议。您几乎可以从维基百科中了解您需要了解的所有内容: http://en.wikipedia.org/wiki /Simple_Mail_Transfer_Protocol

If you're not worried about public SMTP servers lying to you (take a look at section 2.11 here: https://www.rfc-editor.org/rfc/rfc2505), then the best way might actually be to open up a TcpClient to the server and run the SMTP protocol yourself. SMTP is a really, really easy protocol. You can pretty much learn everything you need to know from Wikipedia: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

陈年往事 2024-09-13 02:09:56

通常情况下。

  • VRFY:算了。说真的;)没有服务器会回答——没有理智的人。被垃圾邮件发送者过度使用。

    • 其余部分:使用 TCP 连接到服务器,“直接执行即可”(即对 SMTP 握手进行编程,然后继续)。

Normally.

  • VRFY: Forget it. Seriously ;) No server will answer - no sane one. Was used too much by spammers.

    • For the rest: connect to server using TCP, "just do it" (i.e. program the SMTP handshake, then go on).
零時差 2024-09-13 02:09:56

您可以尝试使用类似的内容:

http://www.vcskicks.com/download -file-ftp.php

使用 SMTP 代替 Ftp。

You could try using something similar to this:

http://www.vcskicks.com/download-file-ftp.php

Instead of using Ftp, use SMTP.

山川志 2024-09-13 02:09:55

我想您会发现,在很多情况下,这些功能会故意对您撒谎,以击败垃圾邮件发送者。如果有一种方法可以确认电子邮件的真实性,而不是让用户点击验证(或取消订阅......)链接,那么垃圾邮件发送者将会非常高兴。

需要明确的是,验证电子邮件地址的最佳方法是向用户发送一封包含链接的电子邮件,然后等待他们单击该链接以验证是否收到了电子邮件。任何其他技术(公司/内部网环境除外)都应该失败和/或欺骗来击败垃圾邮件发送者。

I think you will find that in many instances these functions will intentionally lie to you to defeat spammers. If there were a way to confirm an email is real other than having a user click on a validation (or unsubscribe....) link then spammers would be very happy people.

Just to be clear, the best way to verify an email address is to send a user an email containing a link, and wait for them to click on the link to verify they received the email. Any other technique (with the exception of a corporate/intranet environment) should fail and/or lie to defeat spammers.

宣告ˉ结束 2024-09-13 02:09:55

IMO,RCPT 方法是最好的一种,我仍然每天使用它。

以下是必要的代码: http://mailsystem.codeplex.com/SourceControl/changeset /view/51422#541825

这个类相当重,你必须从源代码中选择你需要的代码片段。

IMO, RCPT method is the best one, and I still use it everyday.

Here are the necessary code : http://mailsystem.codeplex.com/SourceControl/changeset/view/51422#541825

The class is quite heavy, you will have to pick the code snippet you need from the source code.

囍笑 2024-09-13 02:09:55

这里有一个不错的项目,其中包含有关如何实现此目的的代码片段,但作为 Spence提到它们可能并不总是正常工作。

There's a nice project here with code snippets on how to achieve this, but as Spence mentioned they may not always work correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文