且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

确定电子邮件地址的健康/有效性

更新时间:2023-11-25 18:40:52

同意 Jay
全部完成这项工作的漂亮功能通常被关闭...



唯一的方法是发送电子邮件到该地址;即使如此,你也不是100%肯定的。




  • 该地址可以是垃圾;没有人检查它。

  • 邮箱已满(暂时?),您收到DSN

  • SMTP服务器故障/停机



IMHO,不断检查域名(如果您不想获得黑名单,请轻松连接)以及反垃圾邮件工具(如akismet / spamhaus)以过滤用户注册。 / p>

Routine maintenance on a website often involves verifying that links are valid, flagging bad ones, etc.

I know how to match email addresses via a script (especially in the context of a web page where they'd be in mailto: links). My question is how would I verify they're OK without spamming the address?

Stripping-off the domain and verifying it's listening on port 25 is a partial answer, but doesn't handle verifying the username/alias.

Is there a way to add this to my maintenance scripts for websites I manage?

I don't really care what language it's written in, so long as it works :)

Agree with Jay: All the nifty features built to do this particular job are generally turned off...

The only way is sending an email to that address; and even then, you're not 100% sure.

  • That address can be garbage; nobody's checking it.
  • Mailbox is full (temporarily?) and you get a DSN
  • SMTP server glitches/outages

IMHO, keep checking the domain (go easy on connections if you don't want to get blacklisted) and antispam tools like akismet/spamhaus to filter user subsmissions.