Post by jaychoo » Wed Nov 15, 2017 11:17 am

Hi,

I tried setting up Office365 in Opencart but met with internal error. May I know if anyone managed to solve this? I tried with gmail its working.

below is the setting i use for Office365

mail protocol : SMTP
mail parameter : blank
smtp hostname : ssl://smtp.office365.com
smtp username : user@example.com
smtp password : password
smtp port : 587
smtp timeout : 5

Newbie

Posts

Joined
Wed Nov 08, 2017 5:27 pm

Post by straightlight » Wed Nov 15, 2017 12:46 pm

Followed is a documentation on how to setup Office 365 emails as multifunction: https://support.office.com/en-us/articl ... 05d654b4c4 . See the table beginning with: Device or Application setting and value.

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 Choicecloud » Wed Nov 11, 2020 7:28 pm

Office 365 uses TLS.
In the SMTP server : tls://smtp.office365.com

Newbie

Posts

Joined
Sat Jul 18, 2020 2:17 pm

Post by rivanoo » Thu Oct 07, 2021 5:36 am

hello both ssl or tls not work i get error

error
<b>Warning</b>: fsockopen(): unable to connect to tls://smtp.office365.com:587 (Network is unreachable) in <b>/home/ admin/domains/wowmart.cn/public_html/system/library/mail/ smtp.php</b> on line <b>87</b>

Newbie

Posts

Joined
Wed Aug 12, 2020 5:47 am

Post by ADD Creative » Thu Oct 07, 2021 4:14 pm

(Network is unreachable) suggests a network issue. Contact your host, maybe they block outgoing mail.

www.add-creative.co.uk


Expert Member

Posts

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

Post by xyzmetehan » Mon Oct 11, 2021 9:32 am

U must use SSL Port (465)

587 for TLS

Newbie

Posts

Joined
Sun May 02, 2021 10:20 am

Post by straightlight » Tue Oct 12, 2021 1:11 am

xyzmetehan wrote:
Mon Oct 11, 2021 9:32 am
U must use SSL Port (465)

587 for TLS
Choicecloud wrote:
Wed Nov 11, 2020 7:28 pm
Office 365 uses TLS.
In the SMTP server : tls://smtp.office365.com

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 by mona » Tue Oct 12, 2021 2:04 am

Do your lines 81 to 87 of system/library/mail/smtp.php look like this?

Code: Select all

if (substr($this->smtp_hostname, 0, 3) == 'tls') {
$hostname = substr($this->smtp_hostname, 6);
} else {
$hostname = $this->smtp_hostname;
}

$handle = fsockopen($hostname, $this->smtp_port, $errno, $errstr, $this->smtp_timeout);

tls:// is not a scheme like ssl:// and as such OC strips that from the hostname before connecting.
It only uses the tls:// definition in the given hostname as an indication that it needs to issue a STARTTLS command later on.

So fsockopen(): unable to connect to tls://smtp.office365.com:587 (Network is unreachable) should not happen as it should connect to smtp.office365.com:587 not tls://smtp.office365.com:587, tls:// is not a thing.

Connection to smtp.office365.com:587 works just fine as below where only the authentication eventually fails of course.

Mail Test initiated by: xxxxx
Sending from: xxxxx@xxxxxxxxxx
Sending to: xxxxx@xxxxxxxxxx
2021-10-11 15:17:26 - Host resolve: smtp.office365.com->52.98.42.194
2021-10-11 15:17:26 - Connecting to smtp.office365.com at 587
2021-10-11 15:17:26 - socket status: OK
2021-10-11 15:17:26 - SEND: EHLO xxxxxxx
[15:17:26.587644] EHLO 250-HKAPR03CA0010.outlook.office365.com Hello [x.x.x.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2021-10-11 15:17:26 - SEND: STARTTLS
[15:17:26.603244] STARTTLS 220 2.0.0 SMTP server ready
2021-10-11 15:17:26 - SEND: EHLO xxxxxxxxxxxxxxxxxxx
[15:17:26.697447] EHLO 250-HKAPR03CA0010.outlook.office365.com Hello [x.x.x.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

2021-10-11 15:17:26 - SEND: AUTH LOGIN
[15:17:26.713448] AUTH LOGIN 334 VXNlcm5hbWU6
2021-10-11 15:17:26 - SEND: XXXXXXXXXXXXXXXXX base64 username
[15:17:26.731449] base64 username 334 UGFzc3dvcmQ6
2021-10-11 15:17:26 - SEND: XXXXXXXXXXXXXXX base64 password
[15:17:31.751736] base64 password 535 5.7.3 Authentication unsuccessful [HKAPR03CA0010.apcprd03.prod.outlook.com]
535 5.7.3 Authentication unsuccessful [HKAPR03CA0010.apcprd03.prod.outlook.com]

Error: Password not accepted from server
SEND TEST MAIL FAILED

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: nonnedelectari and 225 guests