在Play Framework中将sendmail用作SMTP服务器 [英] Using sendmail as SMTP server in Play Framework

查看:102
本文介绍了在Play Framework中将sendmail用作SMTP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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

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

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.

更新

这应该看起来像这样:


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

失败,因为未定义mail.smtp.from. "mail.debug = true"帮助我发现了这一点.谢谢, Codemwnci

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

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

这篇关于在Play Framework中将sendmail用作SMTP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆