why can not catch SendFailedException
i use transport.sendMessage(msg, msg.getAllRecipients()) to send a mail, the recipients address are wrong
addresses which i set by purpose,however, i can not catch SendFailedException though i can receive address wrong messages from smtp server.why?
what shoud i do if i want to catch SendFailedException?
> is there some other way to solve this problem?
Short answer: No.
Long answer: You can always add lots and lots of heuristics to try to
detect bad addresses in advance. Any heuristics are going to fail to
detect some bad addresses and are likely to consider some good
addresses as bad. You're probably better off taking a step back and
considering why it is you're trying to detect bad addresses and see if
there's a different way to solve the higher level problem.