We have a new Drupal 8 site and are having issues with the SMTP module. The account we are using to send email works successfully on our Drupal 7 sites and in other cases, but we cannot get it to work successfully on Drupal 8. I have also tried another Non-SSL account and am getting the same two messages over and over in the error log.

Error sending e-mail from smtp@website.com to email@email.com: SMTP Error: Could not connect to SMTP host.

Error sending email (from smtp@website.com to email@email.com with reply-to not set).

I have found many similar questions, but not a working solution yet. Any help would be greatly appreciated, thank you in advance!


Doh! It turns out this was not a Drupal issue, but a Centos issue with SELinux. I was able to check SELinx settings by running the following commands

getsebool httpd_can_sendmail

which returned

httpd_can_sendmail --> off


getsebool httpd_can_network_connect


httpd_can_network_connect --> off

I enabled them by running this

setsebool -P httpd_can_sendmail 1

setsebool -P httpd_can_network_connect 1

And the Drupal SMTP module worked beautifully after that. Hopefully this helps someone else as well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.