in reply to
Determine if domain is actually used for email
It has been many years since I read RFC 821/2821, but I seem to recall that certain email addresses were mandatory - such as postmaster. If you truly want to verify if there is a mail server listening on the IP address associated with the MX record, you could do the equivalent of
telnet 10.10.10.10 25
Now of course, many mail servers have the vrfy function turned off because it can be used by spammers for nefarious purposes but the fact that you are communicating with the server on port 25 in a fashion resembling SMTP should be a pretty good indication they handle mail.
I didn't write code that you could use for a reason. Your post itself looks like it might be for spamming purposes. If you don't have someone's email address then why are you checking to see if their domain accepts mail?