问题
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
来源:https://stackoverflow.com/questions/8890616/using-sendmail-as-smtp-server-in-play-framework