I have been asked to implement some email address validation on a web app - I\'m sure we\'ve all been there a thousand times... however, this time I have been asked to do an MX
You can only check if there is an mail server registered for the domain.
If the server also accepts mails and if the address is valid (not syntactically but in the sense that there exists a inbox for it and so on...) you will only find out when sending the e.g. registration email
sample on how to do this in PHP
function mailserver_exists($email) {
list($user,$domain) = split('@',$email);
//included check for 'A' after [comment from bobince][1]
return checkdnsrr($domain,'MX') || checkdnsrr($domain,'A');
}
if(domain_exists('joe@foreigndomain.xx')) {...} else {...}
Yes you can use 'TinyTim@192.184.165.13'
too. The PHP documentation for checkdnsrr(host, type) states
host may either be the IP address in dotted-quad notation or the host name