How can you validate the domain of an email address?
posted 12 years ago
We are using JavaMail 1.2. If the "from" address of the MimeMessage is well-formed but refers to an invalid domain (example email@example.com), an exception is thrown when the message is sent. However, an exception is NOT thrown if a message is sent TO such an address. Is there any way to check to see if the domain of the "from" address is invalid before sending? Also, does anyone know why this behavior is asymmetric? (For example, is it possible to cause emails sent TO invalid domains to fail as well, rather than bouncing?)