Using sendmail as SMTP server in Play Framework

匿名 (未验证) 提交于 2019-12-03 08:59:04

问题:

I have a Play Framework application that sends emails using SMTP server. Now I have a GMail account handling these emails but I do have sendmail installed and want to use it instead.

I have the following configuration in application.conf:

 mail.smtp.host=smtp.gmail.com mail.smtp.user=myaddress@gmail.com mail.smtp.pass=password mail.smtp.channel=ssl 

How can I change these lines so that installed sendmail application is used instead? It's working and I can send emails by "sendmail -v acc@dom.com < mail.txt" commands.

UPDATE

This should look like this:

 mail.smtp.host=localhost mail.smtp.from=My Account  

It was failing because mail.smtp.from was not defined. "mail.debug=true" helped me to find that out. Thanks, Codemwnci!

回答1:

It should be as simple as

mail.smtp.host=localhost # comment old gmail settings #mail.smtp.user=myaddress@gmail.com #mail.smtp.pass=password #mail.smtp.channel=ssl 

See here for all the config properties - http://www.playframework.org/documentation/1.2.4/configuration#mail



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!