Post by TLHIR » Thu Sep 24, 2020 12:09 am

Hi All,
I'm integrating office smtp mail. I've add all the cred to settings >store>mail section. And pop enabled for my office email Id.If I use gmail I receive mail for confirm order , register etc... but then if I integrate Office mail I don't receive any mail for confirm order , register etc... and the screen freezes
and error logs found

PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): Failed to enable crypto in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87

Any help is appreciated.

Please, lemme know I stuck past 3 days.

updated code
following are my creds this my local host

engine - smtp
SMTP Hostname-tls://smtp.office365.com
smtp username - my username
smtp pwd - my pwd
smtpr port -587

error Logs

2020-09-23 14:48:12 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): Failed to enable crypto in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87

If i use default mailer it doesnt work either
it throws
2020-09-24 9:45:10 - PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\mail.php on line 77

Updated - server n local gmail work but not outlook the above errors face dofr local but then the same configuration on to server there are not error thrown in error logs


Server all ports 465/587/25 are all open

Regards,
TLHIR
Last edited by TLHIR on Thu Sep 24, 2020 10:54 pm, edited 4 times in total.

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by ADD Creative » Thu Sep 24, 2020 5:03 am

What OpenCart version, PHP version and mail settings are you using?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Thu Sep 24, 2020 7:17 am

Failed to enable crypto
Port 587 requires crypto with SSL v3. SSL v2 would suffice, however. With a virtual server, it may be harden to enable crypto library. However, on a production server, this may be more doable.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Thu Sep 24, 2020 9:33 am

port 587 is for tls, not ssl so use tls://

Code: Select all

[09:28:58] using mailqueue\smtp adapter
2020-09-24 09:28:58 - Host resolve: smtp.office365.com->52.98.37.34
2020-09-24 09:28:58 - Connecting to smtp.office365.com at 587
2020-09-24 09:28:58 - socket status: OK
2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyy
[09:28:58.343792] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: STARTTLS
[09:28:58.364794] STARTTLS 220 2.0.0 SMTP server ready

2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyyy
[09:28:58.966828] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: AUTH LOGIN
[09:28:58.987829] AUTH LOGIN 334 VXNlcm5hbWU6

2020-09-24 09:28:58 - SEND: ZmZmZmZm base64 username
[09:28:59.9831] base64 username 334 UGFzc3dvcmQ6

2020-09-24 09:28:59 - SEND: ZmZmZmZmZg== base64 password
[09:29:04.33118] base64 password 535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]


sendMailDirectMail: [09:28:58] using mailqueue\smtp adapter
2020-09-24 09:28:58 - Host resolve: smtp.office365.com->52.98.37.34
2020-09-24 09:28:58 - Connecting to smtp.office365.com at 587
2020-09-24 09:28:58 - socket status: OK
2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyy
[09:28:58.343792] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: STARTTLS
[09:28:58.364794] STARTTLS 220 2.0.0 SMTP server ready

2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyy
[09:28:58.966828] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: AUTH LOGIN
[09:28:58.987829] AUTH LOGIN 334 VXNlcm5hbWU6

2020-09-24 09:28:58 - SEND: ZmZmZmZm base64 username
[09:28:59.9831] base64 username 334 UGFzc3dvcmQ6

2020-09-24 09:28:59 - SEND: ZmZmZmZmZg== base64 password
[09:29:04.33118] base64 password 535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]

535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]

7 Error: Password not accepted from server
SEND TEST MAIL FAILED
I do not have your credentials so authentication fails.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by TLHIR » Thu Sep 24, 2020 5:43 pm

ADD Creative wrote:
Thu Sep 24, 2020 5:03 am
What OpenCart version, PHP version and mail settings are you using?
PhpINFo
PHP Version 7.4.3
mail settings---mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
sendmail_from no value no value
sendmail_path no value no value
Internal Sendmail Support for Windows enabled

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by letxobnav » Thu Sep 24, 2020 6:18 pm

those are irrelevant as you are using the smtp class.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ADD Creative » Thu Sep 24, 2020 6:58 pm

TLHIR wrote:
Thu Sep 24, 2020 5:43 pm
ADD Creative wrote:
Thu Sep 24, 2020 5:03 am
What OpenCart version, PHP version and mail settings are you using?
PhpINFo
PHP Version 7.4.3
mail settings---mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
sendmail_from no value no value
sendmail_path no value no value
Internal Sendmail Support for Windows enabled
You still haven't provided your OpenCart version.
It looks like you are on XAMPP on windows. Check you have the following in your php.ini and "OpenSSL support" is enabled in your phpinfo().

Code: Select all

extension=php_openssl.dll
You need to use either tls://smtp.office365.com with port 587 or ssl://smtp.office365.com with port 465. Try these and see what errors you get. The errors you have posted to date no not indicate you have tried the either of the two correct settings.

Note that ss:// doesn't not actually use SSL, starting with PHP 7.2, it will actually only use TLS. Also tls:// will tell OpenCart to not use any encryption to start with but to send a STARTTLS command to upgrade the connection to use TLS once connected.

You can't use the OpenCart "Mail" engine as XAMPP is usually set up to use the included Mercury mail server on localhost.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by TLHIR » Thu Sep 24, 2020 10:43 pm

letxobnav wrote:
Thu Sep 24, 2020 9:33 am
port 587 is for tls, not ssl so use tls://

Code: Select all

[09:28:58] using mailqueue\smtp adapter
2020-09-24 09:28:58 - Host resolve: smtp.office365.com->52.98.37.34
2020-09-24 09:28:58 - Connecting to smtp.office365.com at 587
2020-09-24 09:28:58 - socket status: OK
2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyy
[09:28:58.343792] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: STARTTLS
[09:28:58.364794] STARTTLS 220 2.0.0 SMTP server ready

2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyyy
[09:28:58.966828] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: AUTH LOGIN
[09:28:58.987829] AUTH LOGIN 334 VXNlcm5hbWU6

2020-09-24 09:28:58 - SEND: ZmZmZmZm base64 username
[09:28:59.9831] base64 username 334 UGFzc3dvcmQ6

2020-09-24 09:28:59 - SEND: ZmZmZmZmZg== base64 password
[09:29:04.33118] base64 password 535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]


sendMailDirectMail: [09:28:58] using mailqueue\smtp adapter
2020-09-24 09:28:58 - Host resolve: smtp.office365.com->52.98.37.34
2020-09-24 09:28:58 - Connecting to smtp.office365.com at 587
2020-09-24 09:28:58 - socket status: OK
2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyy
[09:28:58.343792] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: STARTTLS
[09:28:58.364794] STARTTLS 220 2.0.0 SMTP server ready

2020-09-24 09:28:58 - SEND: EHLO yyyyyyyyyyyyyyyyyy
[09:28:58.966828] EHLO 250-HK2PR03CA0056.outlook.office365.com Hello [xxxxxxxxxxxxxx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2020-09-24 09:28:58 - SEND: AUTH LOGIN
[09:28:58.987829] AUTH LOGIN 334 VXNlcm5hbWU6

2020-09-24 09:28:58 - SEND: ZmZmZmZm base64 username
[09:28:59.9831] base64 username 334 UGFzc3dvcmQ6

2020-09-24 09:28:59 - SEND: ZmZmZmZmZg== base64 password
[09:29:04.33118] base64 password 535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]

535 5.7.3 Authentication unsuccessful [HK2PR03CA0056.apcprd03.prod.outlook.com]

7 Error: Password not accepted from server
SEND TEST MAIL FAILED
I do not have your credentials so authentication fails.
tried this too not working

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by TLHIR » Thu Sep 24, 2020 10:46 pm

straightlight wrote:
Thu Sep 24, 2020 7:17 am
Failed to enable crypto
Port 587 requires crypto with SSL v3. SSL v2 would suffice, however. With a virtual server, it may be harden to enable crypto library. However, on a production server, this may be more doable.
Please, check updated question

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by TLHIR » Thu Sep 24, 2020 10:52 pm

ADD Creative wrote:
Thu Sep 24, 2020 6:58 pm
TLHIR wrote:
Thu Sep 24, 2020 5:43 pm
ADD Creative wrote:
Thu Sep 24, 2020 5:03 am
What OpenCart version, PHP version and mail settings are you using?
PhpINFo
PHP Version 7.4.3
mail settings---mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
sendmail_from no value no value
sendmail_path no value no value
Internal Sendmail Support for Windows enabled
You still haven't provided your OpenCart version.
It looks like you are on XAMPP on windows. Check you have the following in your php.ini and "OpenSSL support" is enabled in your phpinfo().

Code: Select all

extension=php_openssl.dll
You need to use either tls://smtp.office365.com with port 587 or ssl://smtp.office365.com with port 465. Try these and see what errors you get. The errors you have posted to date no not indicate you have tried the either of the two correct settings.

Note that ss:// doesn't not actually use SSL, starting with PHP 7.2, it will actually only use TLS. Also tls:// will tell OpenCart to not use any encryption to start with but to send a STARTTLS command to upgrade the connection to use TLS once connected.

You can't use the OpenCart "Mail" engine as XAMPP is usually set up to use the included Mercury mail server on localhost.
tried all this not workin please check my updated question

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by TLHIR » Thu Sep 24, 2020 10:53 pm

letxobnav wrote:
Thu Sep 24, 2020 6:18 pm
those are irrelevant as you are using the smtp class.
please check my update question

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by letxobnav » Thu Sep 24, 2020 11:12 pm

these error log entries are a day apart.
2020-09-23 14:48:12 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): Failed to enable crypto in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87

If i use default mailer it doesnt work either
it throws
2020-09-24 9:45:10 - PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\mail.php on line 77

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ADD Creative » Thu Sep 24, 2020 11:29 pm

You still haven't provided your OpenCart version. You are also making it difficult to help when you keep updating your original post. It's hard to see what has changed.

None of you errors in your original post indicate you have tried tls://smtp.office365.com with port 587. Clear you error log and try tls://smtp.office365.com with port 587 and post the new errors from your error log (please don't update your original post). If port 587 doesn't work, you could try port 25.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by TLHIR » Fri Sep 25, 2020 4:58 pm

Opencart version is 3.x

updated code
following are my creds this my local host

engine - smtp
SMTP Hostname-tls://smtp.office365.com
smtp username - my username
smtp pwd - my pwd
smtpr port -587
I've tried both port 587,25 yet not working

error Logs

2020-09-23 14:48:12 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): Failed to enable crypto in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
2020-09-23 14:48:12 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87

If i use default mailer it doesnt work either
it throws
2020-09-24 9:45:10 - PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\mail.php on line 77

Updated - server n local gmail work but not outlook the above errors face dofr local but then the same configuration on to server there are not error thrown in error logs


Server all ports 465/587/25 are all open

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by TLHIR » Fri Sep 25, 2020 5:23 pm

for the following creds

engine - smtp
SMTP Hostname-tls://smtp.office365.com
smtp username - xyz@abc.com
smtp pwd - my pwd
smtpr port -587

the username used is smtp username - xyz@abc.com not xyz@outlook.com /xyz@office.com

is that the domain issue?


Following is the error log

2020-09-25 9:21:48 - PHP Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87
2020-09-25 9:21:48 - PHP Warning: fsockopen(): unable to connect to tls://smtp.office365.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87

for the following creds

engine - smtp
SMTP Hostname-tls://smtp.office365.com
smtp username - my username
smtp pwd - my pwd
smtpr port -587

Following is the error log

2020-09-25 9:24:14 - PHP Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87
2020-09-25 9:24:14 - PHP Warning: fsockopen(): unable to connect to tls://smtp.office365.com:25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87
Last edited by TLHIR on Fri Sep 25, 2020 5:58 pm, edited 1 time in total.

Newbie

Posts

Joined
Tue Aug 18, 2020 9:08 pm

Post by letxobnav » Fri Sep 25, 2020 5:57 pm

that is because your host cannot resolve a dns lookup for smtp.office365.com.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ADD Creative » Fri Sep 25, 2020 7:25 pm

TLHIR wrote:
Fri Sep 25, 2020 4:58 pm
Opencart version is 3.x
With x being what?
TLHIR wrote:
Fri Sep 25, 2020 4:58 pm
SMTP Hostname-tls://smtp.office365.com
2020-09-23 14:48:12 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in C:\Program Files\XAMPP\htdocs\opencart2\upload\system\library\mail\smtp.php on line 87
Your SMTP Hostname "tls://smtp.office365.com" does not match the hostname "ssl://smtp.office365.com:587" in your error. That is not the error for that hostname. Did you test with that hostname on XAMPP and what error did?
TLHIR wrote:
Fri Sep 25, 2020 5:23 pm
2020-09-25 9:21:48 - PHP Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87
2020-09-25 9:21:48 - PHP Warning: fsockopen(): unable to connect to tls://smtp.office365.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /opt/bitnami/opencart/system/library/mail/smtp.php on line 87
You now seem to be testing on a different web server. As letxobnav pointed out this is a issue with your web server unable to reach your SMTP hostname. However that is not the whole story as your error has the hostname of "tls://smtp.office365.com:587". This is actually impossible as OpenCart strips the "tls://" off the hostname before doing the fsockopen. See the lines of code at the link below.
https://github.com/opencart/opencart/bl ... hp#L81-L87

There is something you are not telling us. Are you using any modifications that could affect them OpenCart mail system? Are you editing the hostnames in the error messages before posting them?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: JessiesBoutique, OSWorX and 513 guests