Wordpress cannot send smtp emails

Issues related to configuring your network
Post Reply
webanditstudio
Posts: 9
Joined: 2019/08/15 12:07:51

Wordpress cannot send smtp emails

Post by webanditstudio » 2019/08/15 12:18:56

I have CentOS 7 installed on a server tower connected to a LAN behind the standard firewall in the vdsl router (BT Business Hub 5).
I am using apache as the web server and Wordpress is working pretty much as I would expect, purely as an internal Intranet.
However, wordpress cannot send emails and I can't figure out why.

I am using the WPmail plugin that allows me to be precise about what email servers Wordpress is using.

Wordpress cannot send emails from its built in smtp service and I have entered my own mail server settings into WPmail to try to send mail through my own external mail server. WPmail has its own built in test email and this always fails with an error that it could not connect to the mail server. This happens however I configure the mail server settings.

I can successfully ping the mail server from a bash prompt so I guess the firewall is allowing an actual connection but how can I tell if it is blocking smtp or blocking any port access (I have tried using smtp ports 25, 465 and 587)?
Any help would me much appreciated please.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Wordpress cannot send smtp emails

Post by TrevorH » 2019/08/15 18:50:06

However, wordpress cannot send emails and I can't figure out why.
Selinux stops httpd from sending email by default unless it's told not to using setsebool -P httpd_can_sendmail 1
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

webanditstudio
Posts: 9
Joined: 2019/08/15 12:07:51

Re: Wordpress cannot send smtp emails

Post by webanditstudio » 2019/08/15 19:13:08

Wow, thanks so much, TrevorH. Worked straight away.
I've spent a full trying to figure that out.
Much appreciated.

richg54
Posts: 1
Joined: 2016/06/08 16:29:51

Re: Wordpress cannot send smtp emails

Post by richg54 » 2020/04/10 17:51:23

Thanks this has been driving me nuts for a few hours. Appreciate the post! Worked like a charm to allow my new wordpress site to talk to our email server.

Post Reply