SMTP Error: Could not connect to SMTP host 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 --&gt; off

and

getsebool httpd_can_network_connect

returned

httpd_can_network_connect --&gt; 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.