Paul Clapham wrote:Why? JavaMail will already throw an exception if you give it a malformed e-mail address. (That was what you meant by "valid", wasn't it?) I don't see why you need to reinvent that wheel.
What I mean was that when I give an invalid email address
abc@sdgdfg.cgrfg then the program validates the email address, gives an error message and gracefully exits the program AND not give a stacktrace in the console or log file.