iT邦幫忙

0

Python3 Email smtplib.SMTPAuthenticationError

  • 分享至 

  • xImage

各位大大好
最近購買了Office365基本商務版, 想要利用python 來寄信, 但是一直出現,smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful error.
測試過是可以從outlook登入郵寄, 但是找了網路文章 , 改過密碼 ,目前Python
還無法郵寄,不知道大家是否有遇過類似的問題, 在此先謝過各位大大.

import smtplib

mailserver = smtplib.SMTP('smtp.office365.com', 587)
mailserver.ehlo()
mailserver.starttls()
mailserver.login('email_add', 'email_password')
mailserver.sendmail('service@y******.com','********@gmail.com', 'python email')
mailserver.quit()

Imgur

froce iT邦大師 1 級 ‧ 2020-04-19 15:58:20 檢舉
https://stackoverflow.com/questions/41239692/send-emal-stmp-office-365-message-empty
試試看。
謝謝回復 但是我是在 mailserver.login('email_add', 'email_password') 這行就掛了. 還沒寄出去 T . T. 參考了https://docs.microsoft.com/zh-tw/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-office-3 還是沒什麼頭緒
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

我要發表回答

立即登入回答