Does anybody know the smtp settings that need to be applied within the application.conf file of a Play Framework project for sending emails on localhost?
During my unit testing I am getting the error:
A play.exceptions.MailException has been caught, Cannot send email
The developers at Play have made sending emails so easy that the only way I could be messing up is with my settings in the config file.
I have tried just using:
mail.smtp=mock
And I tried commenting out the line above and using:
mail.smtp.host=127.0.0.1
Neither of these two approaches work. I understand that this is probably a very noob question, but I have never really dealt with setting up emails before – so I am grateful for any help that can be contributed.
If it is the case that I am unable to send email as Play would not work as an SMTP server, is there any way that I can use mail.smtp=mock to ‘mock send’ an email and allow my tests to pass?
Useful Link
To better diagnose the problem, you can use the following setting (in application.conf) to give more details of the email sending process.
However, for testing purposes, I have found using GMail the easiest method for sending emails.
The configuration (again in application.conf) is…
For full details of all the configurations, the Play Framework page has lots of information on how to do this.
http://www.playframework.org/documentation/1.2.2/emails