Page 1 of 1

Wordpress cannot send smtp emails

Posted: 2019/08/15 12:18:56
by webanditstudio
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.

Re: Wordpress cannot send smtp emails

Posted: 2019/08/15 18:50:06
by TrevorH
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

Re: Wordpress cannot send smtp emails

Posted: 2019/08/15 19:13:08
by webanditstudio
Wow, thanks so much, TrevorH. Worked straight away.
I've spent a full trying to figure that out.
Much appreciated.

Re: Wordpress cannot send smtp emails

Posted: 2020/04/10 17:51:23
by richg54
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.