WordPress Emails using LEMP Application Image & Postfix

October 25, 2014 2.8k views

Right now I am using the LEMP Application image for my droplet. Everything is great except that WordPress can’t send emails via wp_mail() or mail().

I’ve installed postfix and configured it as an Internet Site and supplied my primary domain name (and restarted, of course). Still, no email’s are being sent.

Please no suggestions to use SMTP, I need to be able to override the From: header as I am using Gravity Forms.

I also spun up a LAMP and WordPress droplet to test, same result.

Worried this may be a 25 port issue, but can’t wrap my head around the solution.

1 Answer

Are there any errors in Postfix’s error log?

sudo tail /var/log/mail.err

Can you connect to port 25 on remote servers? What’s the output of:

nc -vz smtp.gmail.com 25
  • *****@*****:~$ sudo tail /var/log/mail.err
    [sudo] password for *****:
    tail: cannot open ‘/var/log/mail.err’ for reading: No such file or directory
    *****@*****:~$ nc -vz smtp.gmail.com 25
    Connection to smtp.gmail.com 25 port [tcp/smtp] succeeded!
Have another answer? Share your knowledge.