How to check if an email address exists without sending an email?

前端 未结 14 1963
半阙折子戏
半阙折子戏 2020-11-22 00:28

I have come across this PHP code to check email address using SMTP without sending an email.

Has anyone tried anything similar or does it work for you? Can you tell

14条回答
  •  执笔经年
    2020-11-22 01:06

    About all you can do is search DNS and ensure the domain that is in the email address has an MX record, other than that there is no reliable way of dealing with this.

    Some servers may work with the rcpt-to method where you talk to the SMTP server, but it depends entirely on the configuration of the server. Another issue may be an overloaded server may return a 550 code saying user is unknown, but this is a temporary error, there is a permanent error (451 i think?) that can be returned. This depends entirely on the configuration of the server.

    I personally would check for the DNS MX record, then send an email verification if the MX record exists.

提交回复
热议问题