c#验证电子邮件地址 [英] c# validate email address

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

问题描述

嗨CPians,

我正在开发软件,通过电子邮件将新闻通讯发送到地址列表。



当前版本通过正则表达式检查电子邮件地址的语法正确性,但我需要对电子邮件的存在进行真正的检查。



你能帮助我吗?谢谢

Hi CPians,
I am developing software for sending newsletters via e-mail to a list of addresses.

the current release checks the syntactic correctness of the email addresses through a regular expression, but I need to integrate a real check on the existence of the email.

Can you help me? Thank you

推荐答案

您无法验证电子邮件是否为正版。如果真正的电子邮件对您很重要,您需要通过验证链接向指定地址发送电子邮件。在提出问题之前,请先进行自己的基础研究,有很多相关文章。
You can't validate that an email is genuine. If genuine emails are important to you you'll need to send an email to the given address with a validation link. Also please do your own basic research before asking a question, there are a lot of articles concerning this already.


除非你发送电子邮件,否则无法检查电子邮件是否真实存在。你会得到答复。 ;)
There's no way to check if email exists in real, unless you send an email and you'll get a reply. ;)


如果通过真实检查电子邮件的存在,您的意思是实际验证电子邮件地址确实存在(并且不仅检查它是否格式正确),您可能会遇到一些困难时期。



实际上,SMTP协议中存在一个命令来检查域是否存在特定地址,但出于安全考虑,邮件服务器不允许外部使用。



所以,如果我是你,我会认真质疑这个要求。



希望这有帮助。
If, by "real check on the existence of the email", you mean actually validate that an email address really exists (and not only checking that it is well-formed), you may experience some hard times.

Indeed, there exists a command in the SMTP protocol to check a domain for the existence of a specific address, but for security reasons most mail servers do not allow its external use.

So, if I were you I would seriously question this requirement.

Hope this helps.


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

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