验证电子邮件域是否存在

Verify that email domain exists(验证电子邮件域是否存在)

本文介绍了验证电子邮件域是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人在验证步骤中检查电子邮件地址的域?例如.如果用户指定 blah@gmail.com 作为其地址,请确认 gmail.com 存在.

Does anyone check the domain of an email address as part of their verification steps? eg. Confirm that gmail.com exists if the user specified blah@gmail.com as their address.

我应该注意,在我的 web 应用中,现有用户可以将邀请转发给他们的朋友.我根本不需要验证这些邀请.相反,我只是想警告我的用户,如果拼写错误等可能会向错误的人发送邀请.这还值得吗?

I should note that in my webapp an existing user can forward invites to their friends. I have no need to verify those invites at all. Rather, I just want to warn my user if a typo etc. may be sending an invite to the wrong person. Is this even worthwhile to do?

推荐答案

您可以在 上进行 dns 查找mx 记录.这是代码项目中的一个示例:
http://www.codeproject.com/KB/IP/dnslookupdotnet.aspx

You could do a dns lookup on the mx record. Here's an example at Code Project:
http://www.codeproject.com/KB/IP/dnslookupdotnet.aspx

这应该可以回答您的问题,但作为旁注,我同意@Franci 的观点,即发送验证消息的旧备用方式更好.如果有人做了所有其他正确的事情来欺骗您的验证,那么您在检查域时真的不会花太多钱.

That should answer your question as asked, but as a side note I agree with @Franci that the old standby of sending a verification message is better. If someone's done everything else right to fool your validation, you're really not buying much in also checking the domain.

这篇关于验证电子邮件域是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:验证电子邮件域是否存在