在Play Framework中将sendmail用作SMTP服务器(Using sendmail as SMTP server in Play Framework)

我有一个Play Framework应用程序,使用SMTP服务器发送电子邮件。 现在我有一个GMail帐户处理这些电子邮件,但我确实安装了sendmail,并希望使用它。

我在application.conf中有以下配置:

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

如何更改这些行以便使用已安装的sendmail应用程序? 它正常工作,我可以通过“sendmail -v acc@dom.com <mail.txt”命令发送电子邮件。

UPDATE

这应该是这样的:

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

它失败了因为mail.smtp.from没有定义。 “mail.debug = true”帮助我找到了答案。 谢谢, Codemwnci

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!

最满意答案

它应该如此简单

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

有关所有配置属性,请参见此处 - http://www.playframework.org/documentation/1.2.4/configuration#mail

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

更多推荐