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:
And I tried commenting out the line above and using:
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?
[This is a link to the Play documentation for sending emails](http://www.playframework.org/documentation/1.2.2/emails#smtp) I would think that you would need to have a mail server setup on your local machine to accept the email. You could use @example.com so that your mail does not go anywhere.
以上就是Sending emails from local host - Play Framework的详细内容，更多请关注web前端其它相关文章！