Verify that email domain exists

前端 未结 5 1350
误落风尘
误落风尘 2021-01-02 05:14

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

5条回答
  •  旧巷少年郎
    2021-01-02 05:50

    The websites that need to validate the user email address usually send an email to that address with a validation link. Checking the domain for the email does not buy you much, since people usually give fake emails on an existing web email provider (usually @gmail.com, @yahoo.com or @hotmail.com)

    If you want to still validate the domain, you should do a DNS check for an MX record for that domain, instead of just checking if the domain is registered.

    Update: Note that the domain part of an email can actually be an IP address (even though this form is strongly discouraged). In this case, you can't verify reliably if there is an SMTP server at that address, unless you actually attempt to connect to it over SMTP. Which is essentially the same as sending an email.

提交回复
热议问题