Question

Send email through SMTP on nginx for a multi-site droplet?

Hey there, I’m passing a hard time configuring mail on nginx. Hope someone could help me. Sorry if it looks dumb but I’m coming for another host provider which has some settings by default.

So, I have a droplet which hosts several websites. They’re mainly in WordPress. The thing I like to do is enable all of them to send emails, so they can receive one from WP when they lost their password, their websites could have a contact form, etc.

I tried all day long (seriously) a way to configure stuff like sendmail, msmtp and alike with no success. I can’t telnet Google on any port (was trying to configure GMail for this) and none of the default tutorials related to PHP mail() function has worked.

It seems to me a concern related to domain names. But since my droplet hosts several websites, I just don’t know what I have to put on my hosts file. It actually have

127.0.0.1 localhost mydropletname mydropletname

whereas mydropletname is the name it appears when I type hostname.

Currently the last log error from my sendmail log file is

Deferred: Connection timed out with alt4.aspmx.l.google.com.

sendmail is configured with default for everything (just hitted YES for all).

I’m desperate. Filling the gap for a colleage that went ouf of our company and I’m pretty new to it. Appreciate any help.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

This comment has been deleted

Hi @tokiBano,

I’m not sure what version of Ubuntu you’re using, but this should apply to all of them. Give this a shot, and let us know how it goes:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04