Please see my comment to the question. First, you need to try to resolve IPs via DNS using the domain name using the class
You can also ping the IPs using the class
You can find some code sample here:
The successful ping does not proof the domain is valid as a mail delivery agent; and the failed ping does not proof the e-mail is not served at this domain, as the domain could be out of service for a short period of time. It just give you an extra criterion for validity, which is itself does not have strictly 100% validity, which is probably impossible with the present day mail delivery system we all use.