我应该如何在javascript或nodeJs中验证电子邮件地址的存在和域名的存在? [英] How should I verify email address existence and domain name existence in javascript or nodeJs?

查看:419
本文介绍了我应该如何在javascript或nodeJs中验证电子邮件地址的存在和域名的存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了很多npm包来验证电子邮件地址和域名。
以下是我尝试的一些npm套餐

I have tried so many npm packages to verify the email address and domain name. Here are the some of the npm packages I have tried

email-check,
email-verify,
email-existence, 
legit,
email-validator and,
email validation 

所有这些都会导致域名存在以及其他一些检查。
但是我必须验证域中存在的特定电子邮件地址。
我应该如何实现这一目标...
任何人都可以帮我找到它
提前致谢!!

all these results in domain name existence and some other checks only. But I have to verify the particular email address exist in the domain. How should I achieve this... Can anyone pls help me to find it out Thanks in advance!!

推荐答案

今天(可能永远不会)以编程方式验证电子邮件地址。

Today (and probably never) it is not possible to programmatically verify an email address.

出于安全和隐私原因,服务器不会允许这样做。

The server its at won't for both security and privacy reasons allow that.

这是有充分理由的。有了这样的解决方案,垃圾邮件发送者等可以遍历所有服务器并获得每个电子邮件地址。

And for a good reason. With such solution, spammers etc. could traverse all the servers and get every email address available.

作为一个说明,有些工具声称是电子邮件验证解决方案。他们通常使用DNS验证,包括MX记录查找,但他们不能100%准确地说,如果存在或不存在电子邮件地址,他们只能获得电子邮件服务器设置的内容。

域名可以是, NSLookup 是可以做到这一点的服务之一。

Domain name can be though, and NSLookup is one of the services that can do that.

更新了

我在SO上找到了一些好的读物(其中第一个实际上是一个欺骗,但不能自己关闭)

I found a few good reads at SO (where the first is actually a dupe, though can't close it myself)

如何验证电子邮件使用常规表达的地址sion?

如何在JavaScript中验证电子邮件地址?

这篇关于我应该如何在javascript或nodeJs中验证电子邮件地址的存在和域名的存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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