Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

python 3.x - SMTP b'535 5.7.3 Authentication unsuccessful

i am trying to send a email using smtplib but getting error "b'535 5.7.3 Authentication unsuccessful". meanwhile my user and password is correct. am able to send message from my personal mail. After ready related post i found there could be SMTP Authentication issue at company server. At company server end SMTP Authentication is enable. Please guide me how to overcome from this error. Below is my code and error log.

import smtplib
server=smtplib.SMTP('smtp-mail.outlook.com',587)
server.ehlo()
server.starttls()
server.set_debuglevel(1)
server.login('user','password')
server.ehlo()

below error log.

send: 'ehlo company.com
'
reply: b'250-PN2PR01CA0167.outlook.office365.com Hello [2409:4052:2e20:7e24:1102:e6fc:fbb1:6b56]
'
reply: b'250-SIZE 157286400
'
reply: b'250-PIPELINING
'
reply: b'250-DSN
'
reply: b'250-ENHANCEDSTATUSCODES
'
reply: b'250-AUTH LOGIN XOAUTH2
'
reply: b'250-8BITMIME
'
reply: b'250-BINARYMIME
'
reply: b'250-CHUNKING
'
reply: b'250 SMTPUTF8
'
reply: retcode (250); Msg: *company*.outlook.office365.com Hello [2409:4052:2e20:7e24:1102:e6fc:fbb1:6b56]
SIZE 157286400
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH LOGIN XOAUTH2
8BITMIME
BINARYMIME
CHUNKING
SMTPUTF8'
send: 'AUTH LOGIN bWFrdW1hckBpbmZpbmVyYS5jb20=
'
reply: b'334 ******
'
reply: retcode (334); Msg:********'
send: 'RGVsaGkjJDU2Nw==
'
reply: b'535 5.7.3 Authentication unsuccessful [PN2PR01CA0167.INDPRD01.PROD.OUTLOOK.COM]
'
reply: retcode (535); Msg: b'5.7.3 Authentication unsuccessful [PN2PR01CA0167.INDPRD01.PROD.OUTLOOK.COM]'
question from:https://stackoverflow.com/questions/65949753/smtp-b535-5-7-3-authentication-unsuccessful

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...