Search code examples
phpemail-validation

How to weed out bad emails (in php)?


I have a site where users register for an account. I have an internal communication system, that sends them an email when they get a private message. I dont force people to confirm their email, so naturally, many enter a fake address.

When they get a PM, it tries to send them an email, but obviously fails, so it keeps retrying and retrying. After a few weeks, the retry queue gets quite big, and it affects server performance (I also dont wanna get blacklisted for all these attempts).

What can I do to solve this issue (other than force people to confirm their email upon registration).


Solution

  • If you don't want to force people to confirm their email because if something goes wrong, they can't access their login straight away, why not do something like this:

    • If they haven't confirmed their E-Mail, don't send PMs, but show them when they are logged in instead. Remind them to confirm their E-Mail.

    • If they have confirmed their E-mail, send them out.

    But anyway, your scenario sounds like a server misconfiguration. Why would a mail server keep re-sending mails that it got a "not deliverable" message for? As far as I know, re-sending mails only occurs when the receiving host was not reachable for technical reasons.