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

June 10, 2016 390 views
WordPress Email Linux Commands PHP Ubuntu

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 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

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.

3 Answers

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:

Postfix is a *mail transfer agent* (MTA), an application used to send and receive email. In this tutorial, we will install and configure Postfix so that it can be used to send emails by local applications only — that is, those installed on the same server that Postfix is installed on.
Have another answer? Share your knowledge.