Answers.Body: <p>If the same credentials work on one server and not another, there's a good chance that you have <code>php-mcrypt</code> installed on one and not the other.  When <code>php-mcrypt</code> is installed, CiviCRM encrypts the SMTP password, and assumes that any passwords are encrypted.  This can be a problem if your PHP environment changed (in particular, <code>php-mcrypt</code> is deprecated and it's very unusual to see it used with PHP 7.2).</p>
  
  <p>The fix is to re-enter the SMTP password and resave.  Hopefully this solves your problem!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-11T21:00:57.910Z
Answers.Text: Ah yes good thinking. PHP might have got upgraded.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-12T14:11:46.947Z
Answers.Text: I went digging and discovered the site is running on PHP 7.1 with php-mcrypt. PHP 7.2 is also available on the server. I'll see if the site is stable on PHP 7.2 and if that fixes the problem. Thanks for the insight.
Answers.UserDisplayName: LyonsDigital
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-12T19:40:19.497Z
Answers.Text: php-mycrypt doesn't seem to be the trouble. Might this help? 
  Sep 12 02:50:07  [info] $backTrace = #0 /home/fpptaweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(952): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /home/fpptaweb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922):
Answers.UserDisplayName: LyonsDigital
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-12T20:48:41.790Z
Answers.Text: I guess the error got cut off in the comment. Can you edit the original question and paste it in there?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-11T20:57:58.637Z
Answers.LastActivityDate: 2019-09-11T20:57:58.637Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Running CiviCRM 5.13.4 on WordPress current version. Everything had been working then we were informed that the site had stopped sending email. I have been trying to re-establish an SMTP connection ever since with no luck. </p>
  
  <ul>
  <li>I have verified the user name and password for the email address using a desktop client </li>
  <li>I have verified that the ports are open and that the CiviCRM server is not blocked by our firewall.</li>
  <li>I have cloned the site with similar results, except that the clone can connect only connect on port 587, but the production site can not connect at all. </li>
  <li>I have been utterly unable to locate any errors from exim, modsecurity or apache on either the CiviCRM server or the mail server.</li>
  </ul>
  
  <p>The only error I get is:</p>
  
  <blockquote>
    <p>Mail Not Sent
    Sending test email: From: fppta@mailprocessing.org To: jlyons@rboa.com
    Oops. Your SMTP settings are incorrect. No test mail has been sent. An
    error occurred when CiviCRM attempted to send an email (via SMTP). If
    you received this error after submitting on online contribution or
    event registration - the transaction was completed, but we were unable
    to send the email receipt. The mail library returned the following
    error message:
     > Failed to connect to mail.mailprocessing.org: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: )] This is probably
    related to a problem in your Outbound Email Settings (Administer
    CiviCRM » System Settings » Outbound Email), OR the FROM email address
    specifically configured for your contribution page or event. Possible
    causes are:   •   Your SMTP Username or Password are incorrect.   •   Your
    SMTP Server (machine) name is incorrect.  •   You need to use a Port
    other than the default port 25 in your environment.   •   Your SMTP
    server is just not responding right now (it is down for some reason).
      •   The FROM Email Address configured for this feature may not be a
    valid sender based on your email service provider rules. Check this
    page for more information.</p>
  </blockquote>
  
  <p>Where should I look next?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-11T19:46:08.650Z
Comments.Text: I know you said the ports are open, but just to double-check if you run `openssl s_client -connect mail.server.name:465` from the server does it connect and give you a greeting?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-11T20:13:48.603Z
Comments.Text: That's one test that I hadn't tried, but it passed with flying colors. I got a rather lengthy and detailed response from the server. The certificate chain looks good, signed by GlobalSign. It looks very complete. Next idea?
Comments.UserDisplayName: LyonsDigital
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-11T20:27:26.330Z
Comments.Text: Do any of the comments here help https://civicrm.stackexchange.com/questions/31850/trouble-connecting-email-to-activity ? I'm not sure if it's the same problem but seems similar and the general idea is to put debug statements in the code to see exactly where it's failing. Also are there any errors listed in civi's ConfigAndLog folder?
Comments.UserDisplayName: Demerit
Tags: <civimail><smtp>
Title: SMTP Connection stopped working
ThreadText: # SMTP Connection stopped working
  
  (Asked by: username_0 on 2019-09-11)
  
  Running CiviCRM 5.13.4 on WordPress current version. Everything had been working then we were informed that the site had stopped sending email. I have been trying to re-establish an SMTP connection ever since with no luck.
  
  * I have verified the user name and password for the email address using a desktop client
  * I have verified that the ports are open and that the CiviCRM server is not blocked by our firewall.
  * I have cloned the site with similar results, except that the clone can connect only connect on port 587, but the production site can not connect at all.
  * I have been utterly unable to locate any errors from exim, modsecurity or apache on either the CiviCRM server or the mail server.
  
  The only error I get is:
  
  > Mail Not Sent
  > Sending test email: From: fppta@mailprocessing.org To: jlyons@rboa.com
  > Oops. Your SMTP settings are incorrect. No test mail has been sent. An
  > error occurred when CiviCRM attempted to send an email (via SMTP). If
  > you received this error after submitting on online contribution or
  > event registration - the transaction was completed, but we were unable
  > to send the email receipt. The mail library returned the following
  > error message:
  >  > Failed to connect to mail.mailprocessing.org: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: )] This is probably
  > related to a problem in your Outbound Email Settings (Administer
  > CiviCRM » System Settings » Outbound Email), OR the FROM email address
  > specifically configured for your contribution page or event. Possible
  > causes are: • Your SMTP Username or Password are incorrect. • Your
  > SMTP Server (machine) name is incorrect. • You need to use a Port
  > other than the default port 25 in your environment. • Your SMTP
  > server is just not responding right now (it is down for some reason).
  > • The FROM Email Address configured for this feature may not be a
  > valid sender based on your email service provider rules. Check this
  > page for more information.
  
  Where should I look next?
  
  **Tags:** civimail, smtp
  
  > **Comments:**
  > **username_1**: I know you said the ports are open, but just to double-check if you run `openssl s_client -connect mail.server.name:465` from the server does it connect and give you a greeting?  
  > **username_0**: That's one test that I hadn't tried, but it passed with flying colors. I got a rather lengthy and detailed response from the server. The certificate chain looks good, signed by GlobalSign. It looks very complete. Next idea?  
  > **username_1**: Do any of the comments here help https://civicrm.stackexchange.com/questions/31850/trouble-connecting-email-to-activity ? I'm not sure if it's the same problem but seems similar and the general idea is to put debug statements in the code to see exactly where it's failing. Also are there any errors listed in civi's ConfigAndLog folder?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-09-11. Score: 1
  
  If the same credentials work on one server and not another, there's a good chance that you have `php-mcrypt` installed on one and not the other. When `php-mcrypt` is installed, CiviCRM encrypts the SMTP password, and assumes that any passwords are encrypted. This can be a problem if your PHP environment changed (in particular, `php-mcrypt` is deprecated and it's very unusual to see it used with PHP 7.2).
  
  The fix is to re-enter the SMTP password and resave. Hopefully this solves your problem!
  
  > **Comments:**
  > **username_1**: Ah yes good thinking. PHP might have got upgraded.  
  > **username_0**: I went digging and discovered the site is running on PHP 7.1 with php-mcrypt. PHP 7.2 is also available on the server. I'll see if the site is stable on PHP 7.2 and if that fixes the problem. Thanks for the insight.  
  > **username_0**: php-mycrypt doesn't seem to be the trouble. Might this help?  Sep 12 02:50:07  [info] $backTrace = #0 /home/fpptaweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(952): CRM_Core_Error::backtrace("backTrace", TRUE) #1 /home/fpptaweb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922):  
  > **username_1**: I guess the error got cut off in the comment. Can you edit the original question and paste it in there?  
  
  ---
  
  