Suitecrm: Outbound Emails SMTP Connect ()

Created on 23 Aug 2017  路  71Comments  路  Source: salesagility/SuiteCRM


Issue

Cannot send outbound emails.

Expected Behavior

The outbound emails should be working.

Actual Behavior

I used to use a web hosting company for my email. I recently switched to gmail and now have SSL/TLS auth. But it is not working.

Steps to Reproduce

Sending any email from anywhere gives an error message.
This includes sending out emails from the admin section in setting up outbound emails with trying to test. As well as just saving the settings there assuming they are correct and trying to send an email from the quote section by selecting "Email Quotation"

Version Info

SuiteCRM 7.9.4

Error Message:
Wed Aug 23 04:47:31 2017 [5628][5a6f3c04-6cdc-72e2-d455-58ca04892a20][FATAL] SugarPHPMailer encountered an error: The outbound mail server selected for the mail account you are using is invalid. Check the settings or select a different mail server for the mail account.
Wed Aug 23 04:47:31 2017 [5628][5a6f3c04-6cdc-72e2-d455-58ca04892a20][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

image

Critical Fix Proposed Bug

Most helpful comment

Glad to hear that worked and you are up and running now. I believe you are having to pass that option because client cert validation is being performed by default by either the OpenSSL library or on Google's side from their servers, which is one of the reasons why I was asking you to change around the host name in your config. Passing that would essentially just disable that check. If you want to check this further, I would start by looking at your OpenSSL config file, the chosen options inside of it and any directories it references for self signed certs or CA's (certificate authorities). Per your previous post, you should like into this file:

c:/usr/local/ssl/openssl.cnf

I'll have to bow out for researching this one further as I've got some blocking issues for my own business that I need to solve as well. I'll try to put in a pull request for this issue later today though in case the maintainers decide they would like to merge this in.

If you ( @mruch2 ) or @pgorod would be kind enough to test my pull request #4168 to fix and enhance issue #4111 if you get some free time, I would appreciate it.

All 71 comments

I should add...
Yes I have 2 step verification on.
Yes I have created a app password for crm
Yes I have changed the security setting for less secure apps to connect.

Is there anything else that I can do to help get this issue addressed?

@mruch2 please don't skip parts of the Issue template... knowing your SuiteCRM version, for example, is not a minor detail for this Issue...

Good point. Version 7.9.4 the latest.

Hi @mruch2, I believe I know the issue. Are having problems just sending the test email on this outbound email account? From your screenshot I am going to assume that you are creating outbound email account that is in addition to the 'system' outbound email account. Please confirm whether or not that is the case. If this is an additional outbound account then yes, this is a bug. I was just debugging through this over the weekend and noticed that the code to test the outbound email will pair up the email address you put into this screen with the password for the default/'system' outbound email account, thus always giving me that same error. Please confirm either way. Thanks.

Either one seems to have the same problem.

@stancel can you please make a nice list of precise "steps to reproduce" the bug? Your description seems the most specific I've seen on this Issue that has been very hard to debug. Thanks!

Using the Admin section I click on email settings. From there you can plugin all the details you need for your email for SMTP. Then hit send test email and i get the error.

I called google support and we have tried everything. This seems like a bug and I really need it fixed. How can we get to the bottom of this faster? Since I seem to be the only person having this issue, can I just update all me SuiteCRM files under the directory with the latest ones? Will I lose anything? Will I gain anything?

@mruch2 I don't think you're the only one with this issue. Have you seen #3709 and #2807 ? I'm not sure they're the same, but there certainly is something fishy going on.

What do you mean "update your SuiteCRM files"? You mean applying the hotfix branch over your 7.9.4 install?

Yes that is what I mean.

Ok so looked at issue 1123 and that sounds like my issue all over again. I tried the TLS setting but that does not work. Nothing else in there seemed viable. Does anyone have a fix for this?

I have seen many cases of this problem. currently I'm not sure which fixes are already a part of 7.9.4, and which ones are still on hotfix waiting to be merged to master.

One thing you can try checking is whether the password is saved and retrieved correctly. There was a bug causing this to fail. Have you spotted the place in the code just before the email gets sent? I had that figured out once but I can't look it up right now...

Hi @mruch2. Please follow these steps and let me know the results. For this test we will only be dealing with the 'system' outbound email account. We'll help you solve the other one in another issue if needed (as it requires a code fix - @pgorod - I will try to get you those details once I get home this evening).

1) Login as the Google User that you are using to send outbound emails.

2) Navigate to this address - https://myaccount.google.com/lesssecureapps (look in the top right hand corner of the page while on that screen to make sure it is showing the correct Gmail / GSuite user. If it is not then click on the icon of that user and switch to the same user you'll be using in SuiteCRM to send outbound emails).

3) Make sure that Allow Less Secure Apps is turned on
screenshot 2017-08-30 13 16 03

4) Navigate to your SuiteCRM URL and login as the admin user

5) Once logged in go to Admin screen --> Email section --> Outbound Email. This should take you to the listings page of the Outbound Email Accounts. (Let me know how many you have listed here in your testing results.)

6) For this test we are only concerned with the "system" email account. That is the default account SuiteCRM will look for when sending out mail from various places in the system (see getSystemMailerSettings() method in the code)
outbound_system_email_account

7) Click into the record for the "system" mailer as seen above and you will be taken to the detail page. Please see screenshot below and verify all details. When you are inputting your Gmail / GSuite username and password please make sure to type them in, instead of copying and pasting them in. The reason for this is to make sure you are not pasting in hidden characters that will prevent the system from properly connecting.
outbound_system_mailer1

8) Then click the "Send Test Email" button and a modal window will appear. Put in your personal email address and click "Send"

9) You should now get a message like seen in the screenshot below along with an email to your personal email. If you get an error here please double check the steps one more time and then let me know the error. This should work for you on the "system" account but not any other outbound email account (due to the bug in the code).
outbound_system_mailer2

Please let me know your results. Thanks.

For my gmail account my less secure apps settings are controlled at the domain level. This was configured when I was working on the issue the first time with a google support tech.

From there I followed your step by step information but still have not gotten the same result as it does not state that there has been an email sent. Here is what I get.

Error Message On Screen:

image

Error Message in Log: (different than the first one I got)
Thu Aug 31 02:05:15 2017 [24100][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
Thu Aug 31 02:05:15 2017 [24100][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Maybe a step closer...?

I don't have time to go through it now, but I believe the other Issues I linked above contained ways to increase the level of error reporting on that SMTP error. That is essential to work this with this bug.

I have set it to debug mode but that has not given me a more granular error message. I changed the setting in the SugarPHPMailer and the class.phpmailer and neither changed anything. I even tried repair rebuild and still no better error message.

Also tried setting the auto TLS to false, didnt think in my case this would matter as I want to use TLS. Tried setting the port to 465 and connection type to SSL to see maybe if that worked and nothing. Same error message.

I seen this mentioned (add extension=openssl.so to php.ini) not sure what this entails but do i need to configure openssl?

Anything else I should try?

Try this PHP script in the source of your SuiteCRM installation:

<?php
require_once 'include/phpmailer/class.phpmailer.php';
require_once 'include/phpmailer/class.smtp.php';

$mail = new PHPMailer;

$mail->SMTPDebug=14;
$mail->Debugoutput='html';
$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com';//   // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = '[email protected]';                  // SMTP username
$mail->Password = 'put-the-password-here';                           // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted
$mail->Port = 587;
$mail->From = '[email protected]'; 
$mail->FromName = 'Gmail Person Name';
$mail->addAddress('[email protected]', 'Some Name');     // Add a recipient
$mail->addReplyTo('[email protected]', 'Gmail Person Name');
//$mail->addCC('[email protected]');
//$mail->addBCC('[email protected]');

$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
//$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'Message has been sent';
}
?>

On my system this works with the following output:

Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Connection: opened
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP h88sm5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 220 smtp.gmail.com ESMTP h88sm5875199wrh.19 - gsmtp
CLIENT -> SERVER: EHLO 10.0.0.200
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [94.62.97.218]"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]"
SMTP -> get_lines(): $str is "250-SIZE 35882577"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME"
SMTP -> get_lines(): $str is "250-STARTTLS"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-STARTTLS"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250-CHUNKING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING"
SMTP -> get_lines(): $str is "250 SMTPUTF8"
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
CLIENT -> SERVER: STARTTLS
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS"
SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
CLIENT -> SERVER: EHLO 10.0.0.200
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [94.62.97.218]"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]"
SMTP -> get_lines(): $str is "250-SIZE 35882577"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME"
SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250-CHUNKING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING"
SMTP -> get_lines(): $str is "250 SMTPUTF8"
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [94.62.97.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
Auth method requested: UNKNOWN
Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
Auth method selected: LOGIN
CLIENT -> SERVER: AUTH LOGIN
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6"
SERVER -> CLIENT: 334 VXNlcm5hnWU6
CLIENT -> SERVER: cdfDSfDffsdFdsffsfsdfsdffsFSf==
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "334 UGthc3dvcmQ6"
SERVER -> CLIENT: 334 UGthc3dvcmQ6
CLIENT -> SERVER: PEFFDFDSFdskFJSDFJDSFDSJFJSDFJSJDSF
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "235 2.7.0 Accepted"
SERVER -> CLIENT: 235 2.7.0 Accepted
CLIENT -> SERVER: MAIL FROM:<[email protected]>
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.1.0 OK h88bn5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 250 2.1.0 OK h88bn5875199wrh.19 - gsmtp
CLIENT -> SERVER: RCPT TO:<[email protected]>
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.1.5 OK h88sm5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 250 2.1.5 OK h88sm5875199wrh.19 - gsmtp
CLIENT -> SERVER: DATA
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "354 Go ahead h88sm5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 354 Go ahead h88sm5875199wrh.19 - gsmtp
CLIENT -> SERVER: Date: Thu, 31 Aug 2017 14:58:48 +0100
CLIENT -> SERVER: To: "Some Name" <[email protected]>
CLIENT -> SERVER: From: "Gmail Person Name" <[email protected]>
CLIENT -> SERVER: Reply-To: "Gmail Person Name" <[email protected]>
CLIENT -> SERVER: Subject: Here is the subject
CLIENT -> SERVER: Message-ID: <[email protected]>
CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.21 (https://github.com/PHPMailer/PHPMailer)
CLIENT -> SERVER: MIME-Version: 1.0
CLIENT -> SERVER: Content-Type: multipart/alternative;
CLIENT -> SERVER: boundary="b1_c48ade8f741c19eca11ab3b63de86c37"
CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
CLIENT -> SERVER:
CLIENT -> SERVER: This is a multi-part message in MIME format.
CLIENT -> SERVER:
CLIENT -> SERVER: --b1_c48ade8f741c19eca11ab3b63de86c37
CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
CLIENT -> SERVER:
CLIENT -> SERVER: This is the body in plain text for non-HTML mail
CLIENT -> SERVER: clients
CLIENT -> SERVER:
CLIENT -> SERVER:
CLIENT -> SERVER: --b1_c48ade8f741c19eca11ab3b63de86c37
CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
CLIENT -> SERVER:
CLIENT -> SERVER: This is the HTML message body <b>in bold!</b>
CLIENT -> SERVER:
CLIENT -> SERVER:
CLIENT -> SERVER:
CLIENT -> SERVER: --b1_c48ade8f741c19eca11ab3b63de86c37--
CLIENT -> SERVER:
CLIENT -> SERVER: .
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.0.0 OK 1504187931 h88sm5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 250 2.0.0 OK 1504187931 h88sm5875199wrh.19 - gsmtp
CLIENT -> SERVER: QUIT
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "221 2.0.0 closing connection h88sm5875199wrh.19 - gsmtp"
SERVER -> CLIENT: 221 2.0.0 closing connection h88sm5875199wrh.19 - gsmtp
Connection: closed
Message has been sent 

I obfuscated quite a few things in there, of course.

I hope this helps!

Here is my output.

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\openssl.so' - The specified module could not be found.
 in Unknown on line 0
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()<br>
Connection: opened<br>
SMTP -&gt; get_lines(): $data is &quot;&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;220 smtp.gmail.com ESMTP j7sm1019888pfb.30 - gsmtp&quot;<br>
SERVER -&gt; CLIENT: 220 smtp.gmail.com ESMTP j7sm1019888pfb.30 - gsmtp<br>
CLIENT -&gt; SERVER: EHLO MIKE-DESKTOP<br>
SMTP -&gt; get_lines(): $data is &quot;&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-smtp.gmail.com at your service, [47.146.134.237]&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-SIZE 35882577&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-8BITMIME&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-STARTTLS&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-ENHANCEDSTATUSCODES&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250-PIPELINING&quot;<br>
SMTP -&gt; get_lines(): $data is &quot;250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;250 SMTPUTF8&quot;<br>
SERVER -&gt; CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250 SMTPUTF8<br>
CLIENT -&gt; SERVER: STARTTLS<br>
SMTP -&gt; get_lines(): $data is &quot;&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;220 2.0.0 Ready to start TLS&quot;<br>
SERVER -&gt; CLIENT: 220 2.0.0 Ready to start TLS<br>
SMTP Error: Could not connect to SMTP host.<br>
CLIENT -&gt; SERVER: QUIT<br>
SMTP -&gt; get_lines(): $data is &quot;&quot;<br>
SMTP -&gt; get_lines(): $str is  &quot;&quot;<br>
SERVER -&gt; CLIENT: <br>
SMTP ERROR: QUIT command failed: <br>
Connection: closed<br>
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting<br>
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

In researching a bit I don't actually see this PHP library that it states it is missing in any of the latest download of PHP I pulled. There is a PHP_Openssl.dll in the folder but no ".so"

'C:\xampp\php\ext\openssl.so'

@mruch2 - if you are on Windows the file extension will be .dll (dynamically linked library) instead of .so (shared object) on Linux. In your Apache and CLI php.ini file(s) you should enable extension=php_openssl.dll
instead of
extension=php_openssl.so

You will need to restart your web server (XAMPP in your case) after making this change in all applicable php.ini files.

Do you have the ability to debug and set a breakpoint? If so, please put on at the following file and line number.

/include/phpmailer/class.phpmailer.php
Line 1683 (for version 7.9.4)
Should look like this: if ($this->SMTPAuth)

Let us know the results.

@stancel - The only difference I got was the first portion of the error message is gone. Outside of that I did not get much further. The breakpoint seems to be ignored as I don't even get step into options. Its like it is not running the code period.

When you said all applicable php.ini files what did you mean?
c:\xampp\phpphp.ini
c:\xampp\htdocs\suitecrmphp.ini

Now when I launch Apache and open the ini from there I believe it is the first one listed above. It also points to an extension directy of c:\xampp\php\ext

Here is the debug output:

Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Connection: opened
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP r87sm1402423pfd.19 - gsmtp"
SERVER -> CLIENT: 220 smtp.gmail.com ESMTP r87sm1402423pfd.19 - gsmtp
CLIENT -> SERVER: EHLO MIKE-DESKTOP
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $str is "250-SIZE 35882577"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME"
SMTP -> get_lines(): $str is "250-STARTTLS"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250 SMTPUTF8"
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250 SMTPUTF8
CLIENT -> SERVER: STARTTLS
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS"
SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
CLIENT -> SERVER: QUIT
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is ""
SERVER -> CLIENT: 
SMTP ERROR: QUIT command failed: 
Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

@mruch2 if you can edit your posts to put the debug outputs inside "code" tags, that would be nice.

Here on GitHub you do that by adding a triple backtick in the beginning and another one in the end.

@mruch2 by looking at your debug outputs, and comparing to mine, it doesn't seem like you're trying to authenticate with Gmail SMTP at all. Can you turn on authentication somehow?

If you post more debug outputs here, make sure you garble any password hashes before posting.

Here is what I am running exactly.

<?php

require_once 'include/phpmailer/class.phpmailer.php';
require_once 'include/phpmailer/class.smtp.php';

$mail = new PHPMailer;

$mail->SMTPDebug=14;
$mail->Debugoutput='html';
$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com';//   // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'email address 1';                  // SMTP username
$mail->Password = 'password';                           // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted
$mail->Port = 587;
$mail->From = 'email address 1'; 
$mail->FromName = 'my company name';
$mail->addAddress('email address 2', 'my name');     // Add a recipient
$mail->addReplyTo('email address 1', 'my company name');
//$mail->addCC('[email protected]');
//$mail->addBCC('[email protected]');

$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
//$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'Message has been sent';
}

?>

Now I tried without TLS. I switched to SSL and port 465 and this is the error I got.

Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): Failed to enable crypto
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error)
SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

@pgorod - Now since I copied your code exactly what could cause there to be no authentication? I am running it in the main folder of SuiteCRM. Path c:\xampp\htdocs\SuiteCRM

I'm afraid I don't know. I would like to compare the outputs of our two debug runs (mine and yours, with the exact same settings), but yours is getting annoying HTML codes (like &quot;) that are not helping... can you get us a clean copy-paste from your browser window?

Also, to advance on your efforts with the php.ini configuration, you can add this line near the end of your script, just before the final ?>

phpinfo();

That will give you a big bunch of information about your configuration, including the exact php.ini paths, and the actually loaded modules.

@mruch2 - for the breakpoint I asked you about adding and debugging through - Can you please look at the value of the username and password variables there and confirm that they match the Gmail/GSuite account that you are trying to connect to? If they are can you please let us know the message value inside the exception?

@stancel I see that is a useful debugging approach if the simple script was able to connect to SMTP. Then we could check for SuiteCRM bugs (namely the infamous missing password).

But if the script can't send (using the same PHP environment, and the same mailer class, and the same details as mine), then that seems to indicate a previous configuration problem, don't you agree?

Ok I did some researching because I noticed that my debugger VS Code was not picking up any breakpoints even in the initial file. So what I did was research how to configure it. I have that setup now. I have an error that I think may lead us down a path that we need to go.

On line 367 of class.smtp.php I get this error.

Exception has occurred.
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

So the previous comment I was running with TLS and port 587 now I am running with SSL and port 465.

On line 1541 of class.phpmailer.php it is throwing a different exception.

Exception has occurred.
phpmailerException: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

N

Ok I looked up the error I got and there was a recommendation on how to get around this so I tried to see if it worked and it sort of does. The problem is there is no success call back so it does not look like and email was sent.

So I changed line 275 of class.phpmailer.php to this for the moment.

public $SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        )
    );

So understanding this. What do I do now?

Can you remove that from within class phpmailer, add this to my script somwhere when setting all the fields for the email:

$mail->SMTPOptions = array(
    'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);

then run the script and post the full output (without phpinfo!), making sure you don't turn HTML entities into things like &quot; (a simple copy-paste should work fine!).

Here is the output.

Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),)
Connection: opened
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 220 smtp.gmail.com ESMTP t64sm4183218pfi.85 - gsmtp
CLIENT -> SERVER: EHLO MIKE-DESKTOP
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $str is "250-SIZE 35882577"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME"
SMTP -> get_lines(): $str is "250-STARTTLS"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250 SMTPUTF8"
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250 SMTPUTF8
CLIENT -> SERVER: STARTTLS
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS"
SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
CLIENT -> SERVER: EHLO MIKE-DESKTOP
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]"
SMTP -> get_lines(): $str is "250-SIZE 35882577"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME"
SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250 SMTPUTF8"
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250 SMTPUTF8
Auth method requested: UNKNOWN
Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
Auth method selected: LOGIN
CLIENT -> SERVER: AUTH LOGIN
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6"
SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: 12345
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6"
SERVER -> CLIENT: 334 UGFzc3dvcmQ6
CLIENT -> SERVER: 1234
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "235 2.7.0 Accepted"
SERVER -> CLIENT: 235 2.7.0 Accepted
CLIENT -> SERVER: MAIL FROM:<From Email>
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.1.0 OK t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 250 2.1.0 OK t64sm4183218pfi.85 - gsmtp
CLIENT -> SERVER: RCPT TO:<To Email>
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.1.5 OK t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 250 2.1.5 OK t64sm4183218pfi.85 - gsmtp
CLIENT -> SERVER: DATA
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "354 Go ahead t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 354 Go ahead t64sm4183218pfi.85 - gsmtp
CLIENT -> SERVER: Date: Sat, 2 Sep 2017 15:50:33 +0200
CLIENT -> SERVER: To: TO Name <To Email>
CLIENT -> SERVER: From: Mrom Name <From Email>
CLIENT -> SERVER: Reply-To: From Name <From Email>
CLIENT -> SERVER: Subject: Here is the subject
CLIENT -> SERVER: Message-ID: <4b4d38903faef30630cb98a56adbf703@MIKE-DESKTOP>
CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.21 (https://github.com/PHPMailer/PHPMailer)
CLIENT -> SERVER: MIME-Version: 1.0
CLIENT -> SERVER: Content-Type: multipart/alternative;
CLIENT -> SERVER: boundary="b1_4b4d38903faef30630cb98a56adbf703"
CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
CLIENT -> SERVER: 
CLIENT -> SERVER: This is a multi-part message in MIME format.
CLIENT -> SERVER: 
CLIENT -> SERVER: --b1_4b4d38903faef30630cb98a56adbf703
CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
CLIENT -> SERVER: 
CLIENT -> SERVER: This is the body in plain text for non-HTML mail
CLIENT -> SERVER: clients
CLIENT -> SERVER: 
CLIENT -> SERVER: 
CLIENT -> SERVER: --b1_4b4d38903faef30630cb98a56adbf703
CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
CLIENT -> SERVER: 
CLIENT -> SERVER: This is the HTML message body <b>in bold!</b>
CLIENT -> SERVER: 
CLIENT -> SERVER: 
CLIENT -> SERVER: 
CLIENT -> SERVER: --b1_4b4d38903faef30630cb98a56adbf703--
CLIENT -> SERVER: 
CLIENT -> SERVER: .
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250 2.0.0 OK 1504360238 t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 250 2.0.0 OK 1504360238 t64sm4183218pfi.85 - gsmtp
CLIENT -> SERVER: QUIT
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "221 2.0.0 closing connection t64sm4183218pfi.85 - gsmtp"
SERVER -> CLIENT: 221 2.0.0 closing connection t64sm4183218pfi.85 - gsmtp
Connection: closed
Message has been sent

Here is something interesting. I turned the code back on for the pubil SMTPOptions inside class.phpmailer.php and had a couple invoices I marked as paid. I have a task that runs that sends an email that says thank you for your payment. This is what the change of that field returned as an error to the html screen.

2017-09-02 14:02:34 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP a15sm4887234pfl.1 - gsmtp
2017-09-02 14:02:34 CLIENT -> SERVER: EHLO localhost
2017-09-02 14:02:34 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250 SMTPUTF8
2017-09-02 14:02:34 CLIENT -> SERVER: STARTTLS
2017-09-02 14:02:34 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2017-09-02 14:02:34 CLIENT -> SERVER: EHLO localhost
2017-09-02 14:02:34 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [47.146.134.237]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250 SMTPUTF8
2017-09-02 14:02:34 CLIENT -> SERVER: AUTH LOGIN
2017-09-02 14:02:34 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2017-09-02 14:02:34 CLIENT -> SERVER: c2FsZXNAbWVyZWZpbmVkZGVzaWducy5jb20=
2017-09-02 14:02:34 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2017-09-02 14:02:34 CLIENT -> SERVER: UzFhY2szcjU=
2017-09-02 14:02:34 SERVER -> CLIENT: 235 2.7.0 Accepted
2017-09-02 14:02:34 CLIENT -> SERVER: MAIL FROM: 
2017-09-02 14:02:34 SERVER -> CLIENT: 250 2.1.0 OK a15sm4887234pfl.1 - gsmtp
2017-09-02 14:02:34 CLIENT -> SERVER: RCPT TO: 
2017-09-02 14:02:34 SERVER -> CLIENT: 250 2.1.5 OK a15sm4887234pfl.1 - gsmtp
2017-09-02 14:02:34 CLIENT -> SERVER: DATA
2017-09-02 14:02:35 SERVER -> CLIENT: 354 Go ahead a15sm4887234pfl.1 - gsmtp
2017-09-02 14:02:35 CLIENT -> SERVER: Date: Sat, 2 Sep 2017 16:02:34 +0200
2017-09-02 14:02:35 CLIENT -> SERVER: To: [email protected]
2017-09-02 14:02:35 CLIENT -> SERVER: From: ME Refined Designs 
2017-09-02 14:02:35 CLIENT -> SERVER: Subject: ME Refined Designs Order Confirmation #: 25177
2017-09-02 14:02:35 CLIENT -> SERVER: Message-ID: <3a66583b9b13c411609d7fb76af5f2be@localhost>
2017-09-02 14:02:35 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.21 (https://github.com/PHPMailer/PHPMailer)
2017-09-02 14:02:35 CLIENT -> SERVER: MIME-Version: 1.0
2017-09-02 14:02:35 CLIENT -> SERVER: Content-Type: multipart/alternative;
2017-09-02 14:02:35 CLIENT -> SERVER: boundary="b1_3a66583b9b13c411609d7fb76af5f2be"
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: This is a multi-part message in MIME format.
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: --b1_3a66583b9b13c411609d7fb76af5f2be
2017-09-02 14:02:35 CLIENT -> SERVER: Content-Type: text/plain; charset=UTF-8
2017-09-02 14:02:35 CLIENT -> SERVER: Content-Transfer-Encoding: quoted-printable
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: [email protected]=C2=A0ORDER CONFIRMATIONInvoice Number:25177 Invo=
2017-09-02 14:02:35 CLIENT -> SERVER: ice Date:2017-09-01 Due Date:2017-09-01 Customer Name:Amber Foster Payment =
2017-09-02 14:02:35 CLIENT -> SERVER: Terms:Prepay PayPal Delivery Date:2017-09-07 =C2=A0Hello Amber Foster ,Than=
2017-09-02 14:02:35 CLIENT -> SERVER: k you for your purchase. We have recieved payment and will begin manufactur=
2017-09-02 14:02:35 CLIENT -> SERVER: ing your product. Please contact us if you have any further questions.
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: --b1_3a66583b9b13c411609d7fb76af5f2be
2017-09-02 14:02:35 CLIENT -> SERVER: Content-Type: text/html; charset=UTF-8
2017-09-02 14:02:35 CLIENT -> SERVER: Content-Transfer-Encoding: quoted-printable
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: if;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:0px 30px;m=
2017-09-02 14:02:35 CLIENT -> SERVER: argin:0px auto;width:600px;background-color:rgb(250,250,250);">
2017-09-02 14:02:35 CLIENT -> SERVER: e=3D"font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22=
2017-09-02 14:02:35 CLIENT -> SERVER: ..4px;color:rgb(68,68,68);padding:0px;margin:0px;">
2017-09-02 14:02:35 CLIENT -> SERVER: px;border:3px solid rgb(157,163,166);padding:15px;font-family:Arial, Helvet=
2017-09-02 14:02:35 CLIENT -> SERVER: ica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);margi=
2017-09-02 14:02:35 CLIENT -> SERVER: n:0px 20px;" class=3D"mce-item-table">2017-09-02 14:02:35 CLIENT -> SERVER: lvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);p=
2017-09-02 14:02:35 CLIENT -> SERVER: adding:0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: if;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:5px 0px;ma=
2017-09-02 14:02:35 CLIENT -> SERVER: rgin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: 14px;line-height:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin=
2017-09-02 14:02:35 CLIENT -> SERVER: :0px;">
2017-09-02 14:02:35 CLIENT -> SERVER: tica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padd=
2017-09-02 14:02:35 CLIENT -> SERVER: ing:3px 3px 3px 0px;margin:0px;" class=3D"mce-item-table">2017-09-02 14:02:35 CLIENT -> SERVER: ont-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;c=
2017-09-02 14:02:35 CLIENT -> SERVER: olor:rgb(68,68,68);padding:0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68=
2017-09-02 14:02:35 CLIENT -> SERVER: );padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: , Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,1=
2017-09-02 14:02:35 CLIENT -> SERVER: 00);padding:3px 3px 3px 0px;margin:0px;">
2017-09-02 14:02:35 CLIENT -> SERVER: idth:100%;text-align:center;border-spacing:0px;font-family:Arial, Helvetica=
2017-09-02 14:02:35 CLIENT -> SERVER: , sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:=
2017-09-02 14:02:35 CLIENT -> SERVER: 3px 3px 3px 0px;margin:0px;" class=3D"mce-item-table">2017-09-02 14:02:35 CLIENT -> SERVER: family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color=
2017-09-02 14:02:35 CLIENT -> SERVER: :rgb(68,68,68);padding:0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: vetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);pa=
2017-09-02 14:02:35 CLIENT -> SERVER: dding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);padding:3px 3p=
2017-09-02 14:02:35 CLIENT -> SERVER: x 3px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: JCtLJAMFo3dkdfcVFrTW8" alt=3D"" height=3D"200" border=3D"0" style=3D"font-f=
2017-09-02 14:02:35 CLIENT -> SERVER: amily:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:=
2017-09-02 14:02:35 CLIENT -> SERVER: rgb(68,68,68);padding:0px;margin:0px;" />2017-09-02 14:02:35 CLIENT -> SERVER: :Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(6=
2017-09-02 14:02:35 CLIENT -> SERVER: 8,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: tica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);pad=
2017-09-02 14:02:35 CLIENT -> SERVER: ding:3px 3px 3px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: y:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;padding:0p=
2017-09-02 14:02:35 CLIENT -> SERVER: x;margin:0px auto;" href=3D"mailto:[email protected]">sales@merefi=
2017-09-02 14:02:35 CLIENT -> SERVER: neddesigns.com2017-09-02 14:02:35 CLIENT -> SERVER: -serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:5px 0p=
2017-09-02 14:02:35 CLIENT -> SERVER: x;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: ize:14px;line-height:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;ma=
2017-09-02 14:02:35 CLIENT -> SERVER: rgin:0px;"> 2017-09-02 14:02:35 CLIENT -> SERVER: serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:5px 0px=
2017-09-02 14:02:35 CLIENT -> SERVER: ;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: 0px;color:rgb(157,163,166);font-family:Helvetica, Arial, sans-serif;font-w=
2017-09-02 14:02:35 CLIENT -> SERVER: eight:bold;margin:0px 0px 8px;font-size:30px;line-height:48px;" colspan=3D"=
2017-09-02 14:02:35 CLIENT -> SERVER: 2">ORDER CONFIRMATION2017-09-02 14:02:35 CLIENT -> SERVER: family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color=
2017-09-02 14:02:35 CLIENT -> SERVER: :rgb(68,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: -family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;colo=
2017-09-02 14:02:35 CLIENT -> SERVER: r:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">
2017-09-02 14:02:35 CLIENT -> SERVER: :100%;text-align:center;border-spacing:0px;border:3px solid rgb(221,221,221=
2017-09-02 14:02:35 CLIENT -> SERVER: );font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4p=
2017-09-02 14:02:35 CLIENT -> SERVER: x;color:rgb(68,68,68);padding:3px 3px 3px 0px;margin:0px;" cellpadding=3D"2=
2017-09-02 14:02:35 CLIENT -> SERVER: " align=3D"right" class=3D"mce-item-table">2017-09-02 14:02:35 CLIENT -> SERVER: l, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,=
2017-09-02 14:02:35 CLIENT -> SERVER: 68);padding:0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: s-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:5px 0=
2017-09-02 14:02:35 CLIENT -> SERVER: px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: rder-bottom:1px solid rgb(221,221,221);border-right:1px solid rgb(221,221,2=
2017-09-02 14:02:35 CLIENT -> SERVER: 21);border-spacing:0px;font-family:Arial, Helvetica, sans-serif;font-size:1=
2017-09-02 14:02:35 CLIENT -> SERVER: 4px;line-height:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin:=
2017-09-02 14:02:35 CLIENT -> SERVER: 0px;">Invoice Number:2017-09-02 14:02:35 CLIENT -> SERVER: ottom:1px solid rgb(221,221,221);border-spacing:0px;font-family:Arial, Helv=
2017-09-02 14:02:35 CLIENT -> SERVER: etica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);pa=
2017-09-02 14:02:35 CLIENT -> SERVER: dding:3px 3px 3px 0px;margin:0px;">251772017-09-02 14:02:35 CLIENT -> SERVER: Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68=
2017-09-02 14:02:35 CLIENT -> SERVER: ,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: t;font-weight:bold;border-bottom:1px solid rgb(221,221,221);border-right:1p=
2017-09-02 14:02:35 CLIENT -> SERVER: x solid rgb(221,221,221);border-spacing:0px;font-family:Arial, Helvetica, s=
2017-09-02 14:02:35 CLIENT -> SERVER: ans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);padding:3p=
2017-09-02 14:02:35 CLIENT -> SERVER: x 3px 3px 0px;margin:0px;">Invoice Date:2017-09-02 14:02:35 CLIENT -> SERVER: ign:center;border-bottom:1px solid rgb(221,221,221);border-spacing:0px;font=
2017-09-02 14:02:35 CLIENT -> SERVER: -family:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;colo=
2017-09-02 14:02:35 CLIENT -> SERVER: r:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">2017-09-01<=
2017-09-02 14:02:35 CLIENT -> SERVER: tr style=3D"font-family:Arial, Helvetica, sans-serif;font-size:14px;line-he=
2017-09-02 14:02:35 CLIENT -> SERVER: ight:22.4px;color:rgb(68,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: idth:50%;text-align:right;font-weight:bold;border-bottom:1px solid rgb(221,=
2017-09-02 14:02:35 CLIENT -> SERVER: 221,221);border-right:1px solid rgb(221,221,221);border-spacing:0px;font-fa=
2017-09-02 14:02:35 CLIENT -> SERVER: mily:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:r=
2017-09-02 14:02:35 CLIENT -> SERVER: gb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">Due Date:2017-09-02 14:02:35 CLIENT -> SERVER: =3D"width:50%;text-align:center;border-bottom:1px solid rgb(221,221,221);bo=
2017-09-02 14:02:35 CLIENT -> SERVER: rder-spacing:0px;font-family:Arial, Helvetica, sans-serif;font-size:14px;li=
2017-09-02 14:02:35 CLIENT -> SERVER: ne-height:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">=
2017-09-02 14:02:35 CLIENT -> SERVER: 2017-09-012017-09-02 14:02:35 CLIENT -> SERVER: ont-size:14px;line-height:22.4px;color:rgb(68,68,68);padding:5px 0px;margin=
2017-09-02 14:02:35 CLIENT -> SERVER: :0px;">2017-09-02 14:02:35 CLIENT -> SERVER: om:1px solid rgb(221,221,221);border-right:1px solid rgb(221,221,221);borde=
2017-09-02 14:02:35 CLIENT -> SERVER: r-spacing:0px;font-family:Arial, Helvetica, sans-serif;font-size:14px;line-=
2017-09-02 14:02:35 CLIENT -> SERVER: height:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">Cus=
2017-09-02 14:02:35 CLIENT -> SERVER: tomer Name:2017-09-02 14:02:35 CLIENT -> SERVER: solid rgb(221,221,221);border-spacing:0px;font-family:Arial, Helvetica, san=
2017-09-02 14:02:35 CLIENT -> SERVER: s-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);padding:3px =
2017-09-02 14:02:35 CLIENT -> SERVER: 3px 3px 0px;margin:0px;">Amber Foster2017-09-02 14:02:35 CLIENT -> SERVER: al, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68=
2017-09-02 14:02:35 CLIENT -> SERVER: ,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: ont-weight:bold;border-bottom:1px solid rgb(221,221,221);border-right:1px s=
2017-09-02 14:02:35 CLIENT -> SERVER: olid rgb(221,221,221);border-spacing:0px;font-family:Arial, Helvetica, sans=
2017-09-02 14:02:35 CLIENT -> SERVER: -serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);padding:3px 3=
2017-09-02 14:02:35 CLIENT -> SERVER: px 3px 0px;margin:0px;">Payment Terms:2017-09-02 14:02:35 CLIENT -> SERVER: n:center;border-bottom:1px solid rgb(221,221,221);border-spacing:0px;font-f=
2017-09-02 14:02:35 CLIENT -> SERVER: amily:Arial, Helvetica, sans-serif;font-size:14px;line-height:22.4px;color:=
2017-09-02 14:02:35 CLIENT -> SERVER: rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">Prepay PayPal=
2017-09-02 14:02:35 CLIENT -> SERVER: 2017-09-02 14:02:35 CLIENT -> SERVER: eight:22.4px;color:rgb(68,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: width:50%;text-align:right;font-weight:bold;border-right:1px solid rgb(221,=
2017-09-02 14:02:35 CLIENT -> SERVER: 221,221);font-family:Arial, Helvetica, sans-serif;font-size:14px;line-heigh=
2017-09-02 14:02:35 CLIENT -> SERVER: t:22.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;">Delivery=
2017-09-02 14:02:35 CLIENT -> SERVER: Date:2017-09-02 14:02:35 CLIENT -> SERVER: etica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);pa=
2017-09-02 14:02:35 CLIENT -> SERVER: dding:3px 3px 3px 0px;margin:0px;">2017-09-072017-09-02 14:02:35 CLIENT -> SERVER: >2017-09-02 14:02:35 CLIENT -> SERVER: line-height:22.4px;color:rgb(68,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: le=3D"font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:2=
2017-09-02 14:02:35 CLIENT -> SERVER: 2.4px;color:rgb(83,77,100);padding:3px 3px 3px 0px;margin:0px;"> =
2017-09-02 14:02:35 CLIENT -> SERVER: 2017-09-02 14:02:35 CLIENT -> SERVER: ine-height:22.4px;color:rgb(68,68,68);padding:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: e=3D"padding:10px 3px 3px 0px;vertical-align:top;font-family:Arial, Helveti=
2017-09-02 14:02:35 CLIENT -> SERVER: ca, sans-serif;font-size:14px;line-height:22.4px;color:rgb(83,77,100);margi=
2017-09-02 14:02:35 CLIENT -> SERVER: n:0px;">Hello Amber Foster,2017-09-02 14:02:35 CLIENT -> SERVER: ica, sans-serif;font-size:14px;line-height:22.4px;color:rgb(68,68,68);paddi=
2017-09-02 14:02:35 CLIENT -> SERVER: ng:5px 0px;margin:0px;">2017-09-02 14:02:35 CLIENT -> SERVER: n:top;text-indent:30px;font-family:Arial, Helvetica, sans-serif;font-size:1=
2017-09-02 14:02:35 CLIENT -> SERVER: 4px;line-height:22.4px;color:rgb(83,77,100);margin:0px;">Thank you for your=
2017-09-02 14:02:35 CLIENT -> SERVER: purchase. We have recieved payment and will begin manufacturing your produ=
2017-09-02 14:02:35 CLIENT -> SERVER: ct. Please contact us if you have any further questions.<=
2017-09-02 14:02:35 CLIENT -> SERVER: /table>
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: --b1_3a66583b9b13c411609d7fb76af5f2be--
2017-09-02 14:02:35 CLIENT -> SERVER:
2017-09-02 14:02:35 CLIENT -> SERVER: .
2017-09-02 14:02:36 SERVER -> CLIENT: 250 2.0.0 OK 1504360958 a15sm4887234pfl.1 - gsmtp
2017-09-02 14:02:36 CLIENT -> SERVER: QUIT
2017-09-02 14:02:36 SERVER -> CLIENT: 221 2.0.0 closing connection a15sm4887234pfl.1 - gsmtp

Here is the error inside the sugarcrm.log

Sat Sep  2 16:02:36 2017 [44060][5a6f3c04-6cdc-72e2-d455-58ca04892a20][ERROR] Unable to find relationship emails_email_templates
Sat Sep  2 16:02:36 2017 [44060][5a6f3c04-6cdc-72e2-d455-58ca04892a20][ERROR] Unable to find relationship emails_email_templates
Sat Sep  2 16:02:36 2017 [44060][5a6f3c04-6cdc-72e2-d455-58ca04892a20][ERROR] Unable to find relationship emails_email_templates
Sat Sep  2 16:02:36 2017 [44060][5a6f3c04-6cdc-72e2-d455-58ca04892a20][FATAL] Saving probably failed or bean->save() method did not return with a positive result.

Please let me finish understanding the SMTP connect problem before I move on to anything else. We have to focus on a single issue until we get to the bottom of it.

That email you sent with my script, with the SMTPOptions, seems to have been sent correctly. Did you receive it on the destination?

@pgorod - Sorry definitely don't want to distract from the main issue. Just wanted to add information of the different things I am finding.

I did receive the email on the other end and it looked correct.

@mruch2 I really value what we have achieved on this thread, we've been struggling with this SMTP connect error for months and I feel this is the closest we've gotten to understanding where the problems are.

If this solves your original SMTP problem, I would say let's not mix any other problems in this thread. If you have other subsequent email problems just start a new thread (on the forums, I would say it's more appropriate until we can say for sure something is a bug in the code). I'll help you out there, as much as I can.

Ok, so now we have a specific error message associated with this problem:

Exception has occurred.
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

But you say it's inside phpmailer code, which is not really SuiteCRM, it's just a package we include. While debugging, can you still catch or (test for) that exception when the execution comes out of phpmailer, back to SuiteCRM code?

That's where we could add a clause to test for this condition and give a decent error, or perhaps use the SMTPOptions fix directly (though I don't think we'll do that because it degrades security).

Ok so the thrown exception is in the class.smtp.php when removing the SMTPOptions from the script. The exception reads.

Exception has occurred.
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

It happens on line 367 in this code block of class.smtp.php

// Begin encrypted connection
        if (!stream_socket_enable_crypto(
            $this->smtp_conn,
            true,
            $crypto_method
        )) {
            return false;
        }
        return true;
    }

Ok, but when that returns, and possibly a few other functions return, eventually it will come out of any files in the include/phpmailer directory. The question is if _there_ we can test for this particular error condition. That will depend on how the phpmailer exception handling is designed, I don't know.

When debugging that, where does VSCode take you to when the exception occurs, and in the following steps?

Here are the different areas it refers to.

image

class.phpmailer.php line 1548 refers to the SMTPOptions as an exception thrown. I am not really a PHP guy but this looks to be where the exception is thrown not the failed source. Not sure a little help maybe I can get you a better answer.

Yes, that sort of stack trace is helpful. But now please do it again from within SuiteCRM, not from my script, so we can see the SuiteCRM side of the stack trace.

I'm guessing we'll be taken to EmailMan.php but if you can please confirm that, it would be great. Thanks for your patience.

So I am not sure how to attach it exactly. I turned on "Listen for XDebug" but when I sent an email it did not catch the exception. How exactly do I attach to the process?

I don't know... maybe you can launch SuiteCRM site from within VSCode in debug mode, (setting the breakpoint first to stop where you want)?

If you can't get it to work, maybe it's easier to just add

var_dump(debug_backtrace());

at the point where the exception is thrown. But I've never tried this, I just learned about it in Google...

That did not work either and I don't see anything online about how to attach to process.

Tried changing the logging settings in SuiteCRM to debug but it does not give me the inner exception either.

Exception has occurred. Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

@pgorod and @mruch2 - We should look at this part closer. I think the issue may not be the code, but rather the cipher suites / security protocols that are activated and configured. From @mruch2's error message about his computer may be trying to use the SSLv3 security protocol to connect, but Google no longer accepts those connections over their IMAP and SMTP accounts. (See here: https://gsuiteupdates.googleblog.com/2016/05/disabling-support-for-sslv3-and-rc4-for.html ).

@mruch2 - Can you please share with us a little bit more about the OS (with version), web server (looks like Apache in XAMPP package, but please confirm XAMPP version) and other environment details (version of OpenSSL, cipher suites/security protocols, etc.)? (ex. SSLv2, SSLv3, TLS 1.0, TLS 1.1, TLS 1.2)

Here is my PHPInfo

PHP Version => 7.1.1

System => Windows NT MIKE-DESKTOP 10.0 build 15063 (Windows 10) i586
Build Date => Jan 18 2017 18:37:40
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => C:\WINDOWS
Loaded Configuration File => C:\xampp\htdocs\SuiteCRM\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20160303
PHP Extension => 20160303
Zend Extension => 320160303
Zend Extension Build => API320160303,TS,VC14
PHP Extension Build => API20160303,TS,VC14
Debug Build => no
Thread Safety => enabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports => tcp, udp, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters => convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Xdebug v2.5.4, Copyright (c) 2002-2017, by Derick Rethans


 _______________________________________________________________________


Configuration

bcmath

BCMath support => enabled

Directive => Local Value => Master Value
bcmath.scale => 0 => 0

bz2

BZip2 Support => Enabled
Stream Wrapper support => compress.bzip2://
Stream Filter support => bzip2.decompress, bzip2.compress
BZip2 Version => 1.0.6, 6-Sept-2010

calendar

Calendar support => enabled

Core

PHP Version => 7.1.1

Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => C:\xampp\php\extras\browscap.ini => C:\xampp\php\extras\browscap.ini
default_charset => UTF-8 => UTF-8
default_mimetype => text/html => text/html
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => Off => Off
display_startup_errors => On => On
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => Off => Off
enable_post_data_reading => On => On
error_append_string => no value => no value
error_log => C:\xampp\php\logs\php_error_log => C:\xampp\php\logs\php_error_log
error_prepend_string => no value => no value
error_reporting => 32757 => 32757
expose_php => On => On
extension_dir => C:\xampp\php\ext => C:\xampp\php\ext
file_uploads => On => On
hard_timeout => 2 => 2
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => C:\xampp\php\PEAR => C:\xampp\php\PEAR
input_encoding => no value => no value
internal_encoding => no value => no value
log_errors => On => On
log_errors_max_len => 1024 => 1024
mail.add_x_header => On => On
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_encoding => no value => no value
output_handler => no value => no value
post_max_size => 0 => 0
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => GP => GP
sendmail_from => no value => no value
sendmail_path => no value => no value
serialize_precision => -1 => -1
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
sys_temp_dir => no value => no value
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 20M => 20M
upload_tmp_dir => C:\xampp\tmp => C:\xampp\tmp
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => GPCS => GPCS
windows.show_crt_warning => Off => Off
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
zend.assertions => 1 => 1
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.multibyte => Off => Off
zend.script_encoding => no value => no value

ctype

ctype functions => enabled

curl

cURL support => enabled
cURL Information => 7.51.0
Age => 3
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => No
SPNEGO => Yes
SSL => Yes
SSPI => Yes
TLS-SRP => No
HTTP2 => No
GSSAPI => No
KERBEROS5 => Yes
UNIX_SOCKETS => No
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => i386-pc-win32
SSL Version => OpenSSL/1.0.2j
ZLib Version => 1.2.8
libSSH Version => libssh2/1.8.0

date

date/time support => enabled
"Olson" Timezone Database Version => 2016.10
Timezone Database => internal
Default timezone => Europe/Berlin

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => Europe/Berlin => Europe/Berlin

dom

DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.9.4
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled

exif

EXIF Support => enabled
EXIF Version => 1.4 $Id: 8bdc0c8f27c2c9dd1f7551f1f9fe3ab57a06a4b1 $
Supported EXIF Version => 0220
Supported filetypes => JPEG,TIFF

Directive => Local Value => Master Value
exif.decode_jis_intel => JIS => JIS
exif.decode_jis_motorola => JIS => JIS
exif.decode_unicode_intel => UCS-2LE => UCS-2LE
exif.decode_unicode_motorola => UCS-2BE => UCS-2BE
exif.encode_jis => no value => no value
exif.encode_unicode => ISO-8859-15 => ISO-8859-15

fileinfo

fileinfo support => enabled
version => 1.0.5
libmagic => 522

filter

Input Validation and Filtering => enabled
Revision => $Id: cdc5e15bb616f10210b94ecd8789e66c927a375f $

Directive => Local Value => Master Value
filter.default => unsafe_raw => unsafe_raw
filter.default_flags => no value => no value

ftp

FTP support => enabled
FTPS support => enabled

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.7.0
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 9 compatible
PNG Support => enabled
libPNG Version => 1.6.21
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1

gettext

GetText Support => enabled

hash

hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 

MHASH support => Enabled
MHASH API Version => Emulated Support

iconv

iconv support => enabled
iconv implementation => "libiconv"
iconv library version => 1.14

Directive => Local Value => Master Value
iconv.input_encoding => no value => no value
iconv.internal_encoding => no value => no value
iconv.output_encoding => no value => no value

imap

IMAP c-Client Version => 2007f
SSL Support => enabled

json

json support => enabled
json version => 1.5.0

libxml

libXML support => active
libXML Compiled Version => 2.9.4
libXML Loaded Version => 20904
libXML streams => enabled

mbstring

Multibyte Support => enabled
Multibyte string engine => libmbfl
HTTP input encoding translation => disabled
libmbfl version => 1.3.2
oniguruma version => 5.9.6

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Multibyte (japanese) regex support => enabled
Multibyte regex (oniguruma) version => 5.9.6

Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => no value => no value
mbstring.http_output => no value => no value
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
mbstring.internal_encoding => no value => no value
mbstring.language => neutral => neutral
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value

mcrypt

mcrypt support => enabled
mcrypt_filter support => enabled
Version => 2.5.8
Api No => 20021217
Supported ciphers => cast-128 gost rijndael-128 twofish cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes arcfour 
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream 

Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value

mysqli

MysqlI Support => enabled
Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0

Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off

mysqlnd

mysqlnd => enabled
Version => mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
Compression => supported
core SSL => supported
extended SSL => not supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => Yes
Tracing => n/a
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions => mysqli,pdo_mysql

mysqlnd statistics =>  
bytes_sent => 0
bytes_received => 0
packets_sent => 0
packets_received => 0
protocol_overhead_in => 0
protocol_overhead_out => 0
bytes_received_ok_packet => 0
bytes_received_eof_packet => 0
bytes_received_rset_header_packet => 0
bytes_received_rset_field_meta_packet => 0
bytes_received_rset_row_packet => 0
bytes_received_prepare_response_packet => 0
bytes_received_change_user_packet => 0
packets_sent_command => 0
packets_received_ok => 0
packets_received_eof => 0
packets_received_rset_header => 0
packets_received_rset_field_meta => 0
packets_received_rset_row => 0
packets_received_prepare_response => 0
packets_received_change_user => 0
result_set_queries => 0
non_result_set_queries => 0
no_index_used => 0
bad_index_used => 0
slow_queries => 0
buffered_sets => 0
unbuffered_sets => 0
ps_buffered_sets => 0
ps_unbuffered_sets => 0
flushed_normal_sets => 0
flushed_ps_sets => 0
ps_prepared_never_executed => 0
ps_prepared_once_executed => 0
rows_fetched_from_server_normal => 0
rows_fetched_from_server_ps => 0
rows_buffered_from_client_normal => 0
rows_buffered_from_client_ps => 0
rows_fetched_from_client_normal_buffered => 0
rows_fetched_from_client_normal_unbuffered => 0
rows_fetched_from_client_ps_buffered => 0
rows_fetched_from_client_ps_unbuffered => 0
rows_fetched_from_client_ps_cursor => 0
rows_affected_normal => 0
rows_affected_ps => 0
rows_skipped_normal => 0
rows_skipped_ps => 0
copy_on_write_saved => 0
copy_on_write_performed => 0
command_buffer_too_small => 0
connect_success => 0
connect_failure => 0
connection_reused => 0
reconnect => 0
pconnect_success => 0
active_connections => 0
active_persistent_connections => 0
explicit_close => 0
implicit_close => 0
disconnect_close => 0
in_middle_of_command_close => 0
explicit_free_result => 0
implicit_free_result => 0
explicit_stmt_close => 0
implicit_stmt_close => 0
mem_emalloc_count => 0
mem_emalloc_amount => 0
mem_ecalloc_count => 0
mem_ecalloc_amount => 0
mem_erealloc_count => 0
mem_erealloc_amount => 0
mem_efree_count => 0
mem_efree_amount => 0
mem_malloc_count => 0
mem_malloc_amount => 0
mem_calloc_count => 0
mem_calloc_amount => 0
mem_realloc_count => 0
mem_realloc_amount => 0
mem_free_count => 0
mem_free_amount => 0
mem_estrndup_count => 0
mem_strndup_count => 0
mem_estrdup_count => 0
mem_strdup_count => 0
mem_edupl_count => 0
mem_dupl_count => 0
proto_text_fetched_null => 0
proto_text_fetched_bit => 0
proto_text_fetched_tinyint => 0
proto_text_fetched_short => 0
proto_text_fetched_int24 => 0
proto_text_fetched_int => 0
proto_text_fetched_bigint => 0
proto_text_fetched_decimal => 0
proto_text_fetched_float => 0
proto_text_fetched_double => 0
proto_text_fetched_date => 0
proto_text_fetched_year => 0
proto_text_fetched_time => 0
proto_text_fetched_datetime => 0
proto_text_fetched_timestamp => 0
proto_text_fetched_string => 0
proto_text_fetched_blob => 0
proto_text_fetched_enum => 0
proto_text_fetched_set => 0
proto_text_fetched_geometry => 0
proto_text_fetched_other => 0
proto_binary_fetched_null => 0
proto_binary_fetched_bit => 0
proto_binary_fetched_tinyint => 0
proto_binary_fetched_short => 0
proto_binary_fetched_int24 => 0
proto_binary_fetched_int => 0
proto_binary_fetched_bigint => 0
proto_binary_fetched_decimal => 0
proto_binary_fetched_float => 0
proto_binary_fetched_double => 0
proto_binary_fetched_date => 0
proto_binary_fetched_year => 0
proto_binary_fetched_time => 0
proto_binary_fetched_datetime => 0
proto_binary_fetched_timestamp => 0
proto_binary_fetched_string => 0
proto_binary_fetched_json => 0
proto_binary_fetched_blob => 0
proto_binary_fetched_enum => 0
proto_binary_fetched_set => 0
proto_binary_fetched_geometry => 0
proto_binary_fetched_other => 0
init_command_executed_count => 0
init_command_failed_count => 0
com_quit => 0
com_init_db => 0
com_query => 0
com_field_list => 0
com_create_db => 0
com_drop_db => 0
com_refresh => 0
com_shutdown => 0
com_statistics => 0
com_process_info => 0
com_connect => 0
com_process_kill => 0
com_debug => 0
com_ping => 0
com_time => 0
com_delayed_insert => 0
com_change_user => 0
com_binlog_dump => 0
com_table_dump => 0
com_connect_out => 0
com_register_slave => 0
com_stmt_prepare => 0
com_stmt_execute => 0
com_stmt_send_long_data => 0
com_stmt_close => 0
com_stmt_reset => 0
com_stmt_set_option => 0
com_stmt_fetch => 0
com_deamon => 0
bytes_received_real_data_normal => 0
bytes_received_real_data_ps => 0

openssl

OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.2j  26 Sep 2016
OpenSSL Header Version => OpenSSL 1.0.2j  26 Sep 2016
Openssl default config => c:/usr/local/ssl/openssl.cnf

Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.38 2015-11-23
PCRE JIT Support => enabled

Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.jit => 1 => 1
pcre.recursion_limit => 100000 => 100000

PDO

PDO support => enabled
PDO drivers => mysql, sqlite

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.15.1

Phar

Phar: PHP Archive support => enabled
Phar EXT version => 2.0.2
Phar API version => 1.1.1
SVN revision => $Id: 088487ae35cdd13ad19f99963fc41e925a694aa7 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => enabled
OpenSSL support => enabled


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On

readline

Readline Support => enabled
Readline library => WinEditLine

Directive => Local Value => Master Value
cli.pager => no value => no value
cli.prompt => \b \>  => \b \> 

Reflection

Reflection => enabled
Version => $Id: 102f46dfb2e7666226df074fde0688050c2c1dc2 $

session

Session Support => enabled
Registered save handlers => files user 
Registered serializer handlers => php_serialize php php_binary wddx 

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => Off => Off
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.gc_divisor => 1000 => 1000
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.lazy_write => On => On
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => C:\xampp\tmp => C:\xampp\tmp
session.serialize_handler => php => php
session.sid_bits_per_character => 5 => 5
session.sid_length => 26 => 26
session.upload_progress.cleanup => On => On
session.upload_progress.enabled => On => On
session.upload_progress.freq => 1% => 1%
session.upload_progress.min_freq => 1 => 1
session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix => upload_progress_ => upload_progress_
session.use_cookies => On => On
session.use_only_cookies => On => On
session.use_strict_mode => Off => Off
session.use_trans_sid => 0 => 0

SimpleXML

Simplexml support => enabled
Revision => $Id: 7e5516dcdf2fe6ded7970eaeb6abd8d07df39a2a $
Schema support => enabled

SPL

SPL support => enabled
Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

standard

Dynamic Library Support => enabled
Internal Sendmail Support for Windows => enabled

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.exception => 0 => 0
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
from => no value => no value
session.trans_sid_hosts => no value => no value
session.trans_sid_tags => a=href,area=href,frame=src,form= => a=href,area=href,frame=src,form=
url_rewriter.hosts => no value => no value
url_rewriter.tags => form= => form=
user_agent => no value => no value

tokenizer

Tokenizer Support => enabled

wddx

WDDX Support => enabled
WDDX Session Serializer => enabled

xdebug

xdebug support => enabled
Version => 2.5.4
IDE Key => Mike Ruch

Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $

Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.halt_level => 0 => 0
xdebug.idekey => no value => no value
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => 2 => 2
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_enable_trigger_value => no value => no value
xdebug.profiler_output_dir => C:\Windows\Temp => C:\Windows\Temp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => On => On
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_enable_trigger_value => no value => no value
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => C:\Windows\Temp => C:\Windows\Temp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3

xml

XML Support => active
XML Namespace Support => active
libxml2 Version => 2.9.4

xmlreader

XMLReader => enabled

xmlwriter

XMLWriter => enabled

zip

Zip => enabled
Zip version => 1.13.5
Libzip version => 1.1.2

zlib

ZLib Support => enabled
Stream Wrapper => compress.zlib://
Stream Filter => zlib.inflate, zlib.deflate
Compiled Version => 1.2.8
Linked Version => 1.2.8

Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value

Additional Modules

Module Name

Environment

Variable => Value
ALLUSERSPROFILE => C:\ProgramData
APPDATA => C:\Users\Mike Ruch\AppData\Roaming
CommonProgramFiles => C:\Program Files (x86)\Common Files
CommonProgramFiles(x86) => C:\Program Files (x86)\Common Files
CommonProgramW6432 => C:\Program Files\Common Files
COMPUTERNAME => MIKE-DESKTOP
ComSpec => C:\WINDOWS\system32\cmd.exe
ELECTRON_NO_ASAR => 1
GOOGLE_API_KEY => AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q
HOMEDRIVE => C:
HOMEPATH => \Users\Mike Ruch
LC_NUMERIC => C
LOCALAPPDATA => C:\Users\Mike Ruch\AppData\Local
LOGONSERVER => \\MIKE-DESKTOP
MSMPI_BIN => C:\Program Files\Microsoft MPI\Bin\
NUMBER_OF_PROCESSORS => 8
OneDrive => C:\Users\Mike Ruch\OneDrive
OS => Windows_NT
Path => C:\Program Files\Microsoft MPI\Bin\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\win64;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Google\Google Apps Sync\;C:\Program Files (x86)\Google\Google Apps Migration\;C:\Users\Mike Ruch\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Mike Ruch\AppData\Local\GitHubDesktop\bin
PATHEXT => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE => x86
PROCESSOR_ARCHITEW6432 => AMD64
PROCESSOR_IDENTIFIER => Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL => 6
PROCESSOR_REVISION => 3a09
ProgramData => C:\ProgramData
ProgramFiles => C:\Program Files (x86)
ProgramFiles(x86) => C:\Program Files (x86)
ProgramW6432 => C:\Program Files
PSModulePath => C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\
PUBLIC => C:\Users\Public
SESSIONNAME => Console
SystemDrive => C:
SystemRoot => C:\WINDOWS
TEMP => C:\Users\MIKERU~1\AppData\Local\Temp
TMP => C:\Users\MIKERU~1\AppData\Local\Temp
USERDOMAIN => MIKE-DESKTOP
USERDOMAIN_ROAMINGPROFILE => MIKE-DESKTOP
USERNAME => Mike Ruch
USERPROFILE => C:\Users\Mike Ruch
VSCODE_CWD => C:\Program Files (x86)\Microsoft VS Code
VSCODE_IPC_HOOK => \\.\pipe\code-b16b7b-1.15.1-main-sock
VSCODE_NLS_CONFIG => {"locale":"en-us","availableLanguages":{}}
VSCODE_NODE_CACHED_DATA_DIR_5388 => C:\Users\Mike Ruch\AppData\Roaming\Code\CachedData\41abd21afdf7424c89319ee7cb0445cc6f376959
VSCODE_PID => 5388
windir => C:\WINDOWS

PHP Variables

Variable => Value
$_SERVER['ALLUSERSPROFILE'] => C:\ProgramData
$_SERVER['APPDATA'] => C:\Users\Mike Ruch\AppData\Roaming
$_SERVER['CommonProgramFiles'] => C:\Program Files (x86)\Common Files
$_SERVER['CommonProgramFiles(x86)'] => C:\Program Files (x86)\Common Files
$_SERVER['CommonProgramW6432'] => C:\Program Files\Common Files
$_SERVER['COMPUTERNAME'] => MIKE-DESKTOP
$_SERVER['ComSpec'] => C:\WINDOWS\system32\cmd.exe
$_SERVER['ELECTRON_NO_ASAR'] => 1
$_SERVER['GOOGLE_API_KEY'] => AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q
$_SERVER['HOMEDRIVE'] => C:
$_SERVER['HOMEPATH'] => \Users\Mike Ruch
$_SERVER['LC_NUMERIC'] => C
$_SERVER['LOCALAPPDATA'] => C:\Users\Mike Ruch\AppData\Local
$_SERVER['LOGONSERVER'] => \\MIKE-DESKTOP
$_SERVER['MSMPI_BIN'] => C:\Program Files\Microsoft MPI\Bin\
$_SERVER['NUMBER_OF_PROCESSORS'] => 8
$_SERVER['OneDrive'] => C:\Users\Mike Ruch\OneDrive
$_SERVER['OS'] => Windows_NT
$_SERVER['Path'] => C:\Program Files\Microsoft MPI\Bin\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\win64;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Google\Google Apps Sync\;C:\Program Files (x86)\Google\Google Apps Migration\;C:\Users\Mike Ruch\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Mike Ruch\AppData\Local\GitHubDesktop\bin
$_SERVER['PATHEXT'] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
$_SERVER['PROCESSOR_ARCHITECTURE'] => x86
$_SERVER['PROCESSOR_ARCHITEW6432'] => AMD64
$_SERVER['PROCESSOR_IDENTIFIER'] => Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
$_SERVER['PROCESSOR_LEVEL'] => 6
$_SERVER['PROCESSOR_REVISION'] => 3a09
$_SERVER['ProgramData'] => C:\ProgramData
$_SERVER['ProgramFiles'] => C:\Program Files (x86)
$_SERVER['ProgramFiles(x86)'] => C:\Program Files (x86)
$_SERVER['ProgramW6432'] => C:\Program Files
$_SERVER['PSModulePath'] => C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\
$_SERVER['PUBLIC'] => C:\Users\Public
$_SERVER['SESSIONNAME'] => Console
$_SERVER['SystemDrive'] => C:
$_SERVER['SystemRoot'] => C:\WINDOWS
$_SERVER['TEMP'] => C:\Users\MIKERU~1\AppData\Local\Temp
$_SERVER['TMP'] => C:\Users\MIKERU~1\AppData\Local\Temp
$_SERVER['USERDOMAIN'] => MIKE-DESKTOP
$_SERVER['USERDOMAIN_ROAMINGPROFILE'] => MIKE-DESKTOP
$_SERVER['USERNAME'] => Mike Ruch
$_SERVER['USERPROFILE'] => C:\Users\Mike Ruch
$_SERVER['VSCODE_CWD'] => C:\Program Files (x86)\Microsoft VS Code
$_SERVER['VSCODE_IPC_HOOK'] => \\.\pipe\code-b16b7b-1.15.1-main-sock
$_SERVER['VSCODE_NLS_CONFIG'] => {"locale":"en-us","availableLanguages":{}}
$_SERVER['VSCODE_NODE_CACHED_DATA_DIR_5388'] => C:\Users\Mike Ruch\AppData\Roaming\Code\CachedData\41abd21afdf7424c89319ee7cb0445cc6f376959
$_SERVER['VSCODE_PID'] => 5388
$_SERVER['windir'] => C:\WINDOWS
$_SERVER['PHP_SELF'] => c:\xampp\htdocs\SuiteCRM\Test Email.php
$_SERVER['SCRIPT_NAME'] => c:\xampp\htdocs\SuiteCRM\Test Email.php
$_SERVER['SCRIPT_FILENAME'] => c:\xampp\htdocs\SuiteCRM\Test Email.php
$_SERVER['PATH_TRANSLATED'] => c:\xampp\htdocs\SuiteCRM\Test Email.php
$_SERVER['DOCUMENT_ROOT'] => 
$_SERVER['REQUEST_TIME_FLOAT'] => 1504371120.9707
$_SERVER['REQUEST_TIME'] => 1504371120
$_SERVER['argv'] => Array
(
    [0] => c:\xampp\htdocs\SuiteCRM\Test Email.php
)

$_SERVER['argc'] => 1

PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file:  LICENSE

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact [email protected].

Thanks.

OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.2j 26 Sep 2016 OpenSSL Header Version => OpenSSL 1.0.2j 26 Sep 2016 Openssl default config => c:/usr/local/ssl/openssl.cnf
and
Registered Stream Socket Transports => tcp, udp, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2

are the items I wanted to double check. Seems you do have a version of OpenSSL that is compatible with more modern versions of the security protocols. Let's keep looking.

Ok so what is next?

Hang tight. I have debugged through the issue and can now reproduce it in my local environment (Mac / MAMP / PHP 7.0.15), but it does not happen on my server (Ubuntu 16.04.3 / Apache / PHP 7.0.22).

I have debugged, see two issues happening and have just overcome them in my local to send a successful email. That involved changing the SMTP password variable in memory though. This was the same issue I mentioned previously, but did not have time to fix before. Just double checking some things, be back with you later today with info to try for a fix, or a pull request.

Awesome thanks. Hopefully we can get to the bottom of it. For many peoples sake.

@stancel there are already a few open issues regarding the bugs with saving email passwords. For that aspect of the problem, make sure you explore those issues too: #4057, #3841, and there may be others.

About this one here, the SMTPConnect fail, if we solve it by adding flags called like this...

        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true

... then I think we should investigate exactly these issues, especially the self-signed thing. Does anybody know how the openssl PHP extension handles certificates, where it gets them from? Maybe @mruch2 is running his computer with a self-signed certificate in there?

The phpmailer Troubleshooting Docs have a section on this:
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#php-56-certificate-verification-failure

and basically their advice is to correct the SSL configuration. That's probably the way forward for @mruch2. But for the SuiteCRM project I'm also trying to make this error more apparent and better reported.

@pgorod - wouldnt it use googles certificate as I am sending it through their mailing service? By the way the settings that you have listed there dont exactly work as SuiteCRM does not acknowledge that the email is sent. When sending an email through the quoting module it goes into a forever loading mode even though it sends. It only sends now because I put in that section of code in the phpmailer file.

For whatever reason this does not completely work for SuiteCRM although your script can use it just fine.

Another thing I think you are on to something about the SSL config. Where are the settings for that?

@pgorod - Here is something interesting. Changing some settings to isolate the issue and I noticed that only one option in the array actually matters. I modified the code and got the same result. Here is the passed parameter.

public $SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => false,
            //'verify_peer_name' => false//,
            //'allow_self_signed' => false
        )
    );

There's a certificate on each side, Google identifies itself with one, you identify yourself with another. I really don't know much about certificates, and much less about PHP openssl module certificates. You'll have to Google for it, but at least now you know exactly what to search for: that error message, and that verify_peer option.

I can tell you I never did any certificates configuration to get my emails to send - you might be able to work through this just by playing with your PHP configs.

The other email errors are other email errors. SuiteCRM just underwent a complete rewrite of its Email module, there were many difficulties in this project, it's still a bit wobbly. But my advice is to treat each Issue as a separate Issue: investigate it separately, and report it separately if necessary.

Ok I just went to startssl.com and got a free cert. I installed it through the windows installer tool. Now I am going to try and see if I get a different result. Not sure yet.

Hey guys, so here is where things stand at the moment.

When I first reopened my local debugging environment I was able to recreate the issue and saw that the problem was failing in the startTLS() method inside the PHPMailer library. The logic of the method looks fine, but to test further I modified PHPMailer library file class.smtp.php::startTLS() by adding this backstop onto line 363:
$crypto_method |= STREAM_CRYPTO_METHOD_ANY_CLIENT
The idea behind this was to give the socket the ability to fall back to SSL encryption on the socket - basically still connect using any SSL/TLS method possible (I know this is not the secure long term fix - just getting through the issue at this point). That worked for me but my connection still failed in the PHPMailer library file class.phpmailer.php line 1684:
if (!$this->smtp->authenticate
That failed because I had taken a backup of my Prod DB from the server and restored it onto my local testing environment. Apparently when the outbound passwords are saved they are hashed or salted using some local variable so the base64 encoded value stored in the DB outbound_email.mail_smtppass did not decode to the correct password thus properly causing it to fail there when the wrong password was sent. Re-saving the correct password into the Outbound Email account UI and clicking save updated the hashed (and probably salted) base64 encoded value in outbound_email.mail_smtppass thus enabling me to connect the next time.

Now on to the nitty gritty. Shortly after the initial debug everything was working for me continuously. I was trying to get it to once again fail there like it has for @mruch2. I was finally able to do so by changing the hostname in my config.php. Mine was still set to our production server's value that has a valid wildcard cert signed by a recognized CA. When changing that value to "localhost/SuiteCRM" the SMTP fails there every time like it does for @mruch2.

@mruch2, what is the value of "hostname" in your config.php file?

@stancel - it is localhost.

Do me a favor and temporarily change it to crm.processfast.com and then test again. That is my prod server that has a valid cert setup. Please let me know the results from that test. I believe that Google is trying to test for a valid cert from the calling server and if that fails they send back a failing command to the HELO call being made from SuiteCRM --> PHPMailer --> Gmail/GSuite's server.

Just to confirm the setting I am changing is "host_name" correct? If so that does not appear to have worked.

Yes, you need to change "host_name" in config.php to the value I gave you. Now, try one more thing. Please fully shut down your WAMPP instance, clear your browser's cache and close it. Then reopen the browser, start your WAMPP instance back up, login to your local SuiteCRM instance, try the same steps again. However, if the first test fails I ask you to stay on that page and click the "Send Test Email" button again without refreshing the page. Please let me know if it sends then.

FYI - the reason I am asking for you to perform the test this way is to see if the resource ($this->smtp_conn) is being released or not set properly on the first connection with correct parameters, then on the second request that resource is valid and then working. I have seen a few debugging tests in my local that would lead me to believe that this is the case.

@pgorod - Yes, just changing the SMTP options array to pass the parameter of verify_peer = false, would seem to work, but I think there is more going on than that. If you just want to test that then all you or @mruch2 need to do is put the below lines into the first lines of the SugarPHPMailer::smtpConnect().

$options = ['verify_peer' => false];
$connection = parent::smtpConnect($options);

@stancel - Ok I tried both mentioned next steps. I traded out my host_name flushed browser cache restarted apache. No change. (I did remove the added code that I previously put in the PHPMailer)

I also attempted to simply add the two lines of code mentioned for the $options, recognizing I actually have to modify a line of code that is in this function as $connection = exists, inside the SugarPHPMailer and removing the code that I put into the PHPMailer file itself. This did not net the same result as having the code inside the PHPMailer file.

Edit: Looking at your code further it did not actually match the parameters that we have been passing so I modified the $options statement a little bit. Now it is the same result.

$options = array(
                'ssl' => array(
                    'verify_peer' => false
                )
            );

Edit 2: Ok I have everything working without any internal errors. I changed my host name to my crm site. Then I un-commented the options code inside the SugarPHPMailer.php that you said to place in there and everything appears to work correctly inside sure now. Still need to figure out why we need to pass that option.

Glad to hear that worked and you are up and running now. I believe you are having to pass that option because client cert validation is being performed by default by either the OpenSSL library or on Google's side from their servers, which is one of the reasons why I was asking you to change around the host name in your config. Passing that would essentially just disable that check. If you want to check this further, I would start by looking at your OpenSSL config file, the chosen options inside of it and any directories it references for self signed certs or CA's (certificate authorities). Per your previous post, you should like into this file:

c:/usr/local/ssl/openssl.cnf

I'll have to bow out for researching this one further as I've got some blocking issues for my own business that I need to solve as well. I'll try to put in a pull request for this issue later today though in case the maintainers decide they would like to merge this in.

If you ( @mruch2 ) or @pgorod would be kind enough to test my pull request #4168 to fix and enhance issue #4111 if you get some free time, I would appreciate it.

@mruch2 if you try wrapping the smtpConnect in a try block, can you catch that exception?

In include/SugarPHPMailer.php, around line 362

put a try { just at the start, and some block to catch it at the end.

The function would look like this in the end:

    public function smtpConnect($options = array())
    {
    try {
        $connection = parent::smtpConnect();
        if (!$connection) {
            global $app_strings;
            if (isset($this->oe) && $this->oe->type === 'system') {
                $this->setError($app_strings['LBL_EMAIL_INVALID_SYSTEM_OUTBOUND']);
            } else {
                $this->setError($app_strings['LBL_EMAIL_INVALID_PERSONAL_OUTBOUND']);
            } // else
        }
        return $connection;
     } catch (phpmailerException $e) {
          echo '---------------------------------------------------';
          echo $e->errorMessage(); 
          echo '---------------------------------------------------';
     } catch (Exception $e) {
          echo $e->getMessage(); //error messages from anything else
    }
    } // fn

I'd like to know if we can get that detailed message (Exception has occurred. Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed) from here.

But it seems that for this to work, we'd have to change the statement instantiating PHPMailer to pass true to the constructor. On my script, this looks like this:
$mail = new PHPMailer(true);

But in SuiteCRM, there are many new PHPMailer statements, and I'm not sure which one applies for this... :-( I'm afraid I don't have time to investigate right now...

@mruch2 @stancel @pgorod Hi guys, brilliant job debugging this. I'll label this as a high priority bug for now and we will discuss the implications of this and stancel's proposed fix as soon as possible. Thanks for all the help!

Another experience from the forums, with a different workaround...

Hi all
I installed version 7.9.6 and had the error:
SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting.
I tried several workarounds I found in the forum, like changing files in the include-folder, hardcoding my server settings, trying all combinations in the UI (with port 465, 587, 25 and with SSL, TLS, None) etc etc.
None of these fixed my error.
Now, I finally found a solution, posting it to enable other users to try this fix, if they are fighting with the outgoing email settings:
--> Use n email password which is just made up of a-z, A-Z, 0-9. So, DONT use special characters like +=(),. and so on
I had a complex password with special chars. Changing this fixed it for me :-)

Hope it helps someone, too

I made some progress on this today:

  • I can get the full exception text from smtpConnect and put it in the log: this is really helpful to make the error much more focused and avoids needless mystery. I'll make a PR when I'm finished with all this.
  • I found yet another very misleading case, which surely is tripping a lot of people: the Send test email from the Outbound Accounts configuration uses the From and FromName from the outbound system account. If that is different from the Account you're actually configuring at the moment, that is enough for many SMTP providers to give you a "not authenticated" reply, which sounds like a bad password problem, but actually isn't. Interestingly, in this case, it's the Test email that doesn't work, but then the actual email or campaign might work, because there you are asked for a From address, and if you put in the correct one, the email will send...

All this I tested on a 7.8.7, I expect the same problems apply to 7.9.x, but I'll have to try it someday.

I moved this last case I found to a new Issue #4479.

This Issue here has enough entity by itself (with that verify_peer option).

I suggest closing this one, unless someone has a different opinion.

My logic:

  • we already have full smtp logging visible from the UI, so this error will be much more apparent to the person configuring email
  • the real fix is proper SSL configuration
  • the workaround is insecure (turn off verify_peer), so we shouldn't add it in our code anyway - let people do it manually if they think it's appropriate

Am I right, or am I missing something? Thanks

Was this page helpful?
0 / 5 - 0 ratings