mosaic
By:
mosaic

Wordpress Won't Send Contact Form Emails

January 19, 2016 11k views
WordPress Email

Hi,

I've only just noticed that a few of my Wordpress sites won't send the emails from the Contact form. I am using a plugin called Contact Form 7.

I presume it is because Digital Ocean don't install a SMTP server in the Wordpress 1 click installation.

Does anyone know how i could get these to work. Please bare in mind i am far from a server engineer :-) Thanks in advance for your help.

3 comments
  • not a server admin/pro -- I'm a front end boy. I'm not understanding @kamaln7's instruction unfortunately. I noticed my contact form 7 (the plugin) wasn't able to send emails. I've exhausted myself with research and it looks like the server might be the issue. How can I get some help? I went ahead and typed "sudo service postfix restart" in the console, should this do it? How long does this usually take to function. Thanks!

  • Hi @fit, sorry to hear that. What's the output of nc -z smtp.gmail.com 25? If port 25 is blocked, postfix or any other mail server won't be able to connect to other mail servers to send email, so you need to make sure that port 25 isn't blocked on your Droplet.

  • are you talking about the digital ocean droplet console? Nothing comes up, screenshot: https://www.dropbox.com/s/0jag077zdax57zi/Screenshot%202017-09-08%2014.04.16.png?dl=0

3 Answers

Bloody DigitalOcean not say and and Bloody DigitalOcean interface not NOTICE that sendmail is always blocked, and you need to get permission with support agent. ;-)

All Wordpress one-click droplets have Postfix, a mail server/MTA, installed. You can verify that it's running by looking at the output of:

sudo ps wwaux | grep postfix | grep -v grep

Try running the following command on your droplet:

nc -z smtp.gmail.com 25

If it does not output the following, it's possible that SMTP is blocked on your droplet. In that case, please file a support ticket and the support team will take care of it. Thanks!

Connection to smtp.gmail.com port 25 [tcp/smtp] succeeded!
  • I used the nc... command and console asks for a password. Now what? I don't have one. I did all the Wordpress setup with SSH, and never received an email for root, etc.

@kamaln7

Thank you for your reply.

Postfix was not installed, this is output when I installed it:

The following NEW packages will be installed:
postfix
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.

Is there something additional that i need to select on the one click install?

  • That's weird, how old is your Droplet? Is it possible that you might have accidentally uninstalled it?

    Simply installing Postfix should be enough. I'd recommend, though, configuring it to listen on the local network interface only (assuming you're not using your Droplet as a mail server on the receiving end). To do that, open /etc/postfix/main.cf in your favorite editor:

    sudo nano /etc/postfix/main.cf
    

    Then, find the line that says inet_interfaces = all and replace all with loopback-only. Save the file and restart Postfix:

    sudo service postfix restart
    
Have another answer? Share your knowledge.