play-plugins icon indicating copy to clipboard operation
play-plugins copied to clipboard

How to get EmailException

Open fabiankessler opened this issue 10 years ago • 1 comments

The MailerAPI send() method returns void and doesn't declare any exceptions. Apparently internally there is a Future somewhere and a EmailException, but I don't get that. All I get is a log entry in my log file saying

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465

Now I need to be able to detect this so that I can do whatever (retry, use a fallback mail server, escalate the exception). Also, there is another open issue where someone asks how to test the mailer in a unit test.

I guess I have to use the commons mailer (or whatever package) directly for now.

fabiankessler avatar Jul 11 '13 08:07 fabiankessler