title: Vanilla forum "SMTP Error: Could not connect to SMTP host."
body: <p>Since I upgraded my production site (Linux, Apache) from Vanilla 2.2.1 on PHP 5.5 to Vanilla 2.3.1 on PHP 7.0, my site cannot send emails - failing with the message "SMTP Error: Could not connect to SMTP host."</p>
  
  <p>My settings are:</p>
  
  <ul>
  <li>SMTP Host: smtp.gmail.com</li>
  <li>SMTP User: [my email]</li>
  <li>SMTP Password: [my password]</li>
  <li>SMTP Port: 465</li>
  <li>SMTP Security: SSL</li>
  </ul>
  
  <p>I read many similar questions on SO and tried the following:</p>
  
  <ul>
  <li>Confirm OpenSSL is enabled</li>
  <li>Confirm with the hosting provider that port 465 is not blocked on their firewall</li>
  <li><p>Telnet test on the hosting server gives this:</p>
  
  <pre><code>$ telnet smtp.gmail.com 465
  Trying 108.177.97.108...
  Connected to smtp.gmail.com.
  Escape character is '^]'.
  Connection closed by foreign host.
  </code></pre></li>
  <li>Switching to a different hosting server (same provider) with PHP 7.0, but same error</li>
  </ul>
  
  <p>Not sure if this will be useful information, but when I try TLS with port 587 it gives another error - "Language string failed to load: tls"</p>
  
  <p>My local test site with Vanilla 2.3.1 on PHP 7.0 (Windows, IIS), an identical copy of the production, can send emails without problem with the above SSL settings.</p>
  
  <p>Is there anything else I can try? Any help is appreciated!</p>