Answers.Body: <p>What version did you upgrade from? You may have to set up CRED_KEYS in civicrm.settings.php. See <a href="https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-534" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-534</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-21T03:26:31.670Z
Answers.LastActivityDate: 2021-08-21T03:26:31.670Z
Answers.UserDisplayName: Demerit
Body: <p>After updating to <strong>5.40.2</strong> (running with Wordpress 5.8 on CentOS with CPanel), I cannot send anymore e-mails with SMTP and Gmail.</p>
  <p>Using smtp.gmail.com and port 587 as I have always done returns: <code>STARTTLS failed</code>.</p>
  <p>Using smtp.gmail.com and port 465 returns, when sending a test email:</p>
  <pre><code>Failed to connect to smtp.gmail.com:465 [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM &gt;&gt; Global Settings &gt;&gt; Outbound Email (SMTP). (code: -1, response: )]
  </code></pre>
  <p>Using ssl:// has never worked for me and isn't working now (it returns <code>fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error)</code> or <code>fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error)</code>).</p>
  <p><code>openssl s_client -connect smtp.gmail.com:465</code> and <code>openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587</code> seem to work, so I don't think that's a firewall problem.</p>
  <p>Any ideas? Thanks in advance.</p>
  
Tags: <email><smtp>
Title: CiviCRM + Gmail not working anymore after updating to 5.40.2
ThreadText: # CiviCRM + Gmail not working anymore after updating to 5.40.2
  
  (Asked by: username_0 on 2021-08-19)
  
  After updating to 5.40.2 (running with Wordpress 5.8 on CentOS with CPanel), I cannot send anymore e-mails with SMTP and Gmail.
  Using smtp.gmail.com and port 587 as I have always done returns: STARTTLS failed.
  Using smtp.gmail.com and port 465 returns, when sending a test email:
  Failed to connect to smtp.gmail.com:465 [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: -1, response: )]
  
  Using ssl:// has never worked for me and isn't working now (it returns fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) or fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error)).
  openssl s_client -connect smtp.gmail.com:465 and openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587 seem to work, so I don't think that's a firewall problem.
  Any ideas? Thanks in advance.
  
  **Tags:** email, smtp
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-21. Score: 3
  
  What version did you upgrade from? You may have to set up CRED\_KEYS in civicrm.settings.php. See <https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-534>
  
  
  ---
  
  