Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using sendmail as SMTP server in Play Framework

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
[email protected]
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 [email protected] < 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!

like image 743
Ivan Suhinin Avatar asked Jul 20 '26 17:07

Ivan Suhinin


1 Answers

It should be as simple as

mail.smtp.host=localhost
# comment old gmail settings
#[email protected]
#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

like image 51
Codemwnci Avatar answered Jul 24 '26 14:07

Codemwnci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!