Given an email address, how can I verify that it is valid? (That the email’s domain will accept email for that address.)
How would this look in PHP?
Note: I don’t want to verfify that the email address itself is syntactically valid. I want to know whether the domain will accept email to that address.
I would have thought there was some way to do this with an MX record or something…
I think your only options would be the SMTP RCPT TO or VRFY commands.
RCPT TO could be a way to check, as long as you disconnect after issuing it. However not all servers will boot you if the account doesn’t exist(uce prevention, catch-all addresses, etc…).
VRFY can tell you if an account exists on that server, but this is almost always disabled to prevent account probes.
A PHP class that does RCPT TO verification(among other methods) is: http://code.google.com/p/php-smtp-email-validation/