SMTPAuthenticationError:Django 中的身份驗證不成功 [BL1PR13CA0128.namprd13.prod.outlook.com] (SMTPAuthenticationError: Authentication unsuccessful [BL1PR13CA0128.namprd13.prod.outlook.com] in Django)


問題描述

SMTPAuthenticationError:Django 中的身份驗證不成功 [BL1PR13CA0128.namprd13.prod.outlook.com] (SMTPAuthenticationError: Authentication unsuccessful [BL1PR13CA0128.namprd13.prod.outlook.com] in Django)

我正在嘗試從 Django API 發送和發送電子郵件(從我的個人 hotmail 帳戶)。當我通過 Postman 向本地服務器發出請求時,它可以工作,但是當我在 Heroku 上託管我的應用程序時,它會引發以下異常:

在此處輸入圖片描述

我正在閱讀並且 Hotmail 帳戶具有類似 SMTP 權限:

在此處輸入圖片描述

這是我的 Django 配置變量:


參考解法

方法 1:

Make sure your Outlook account settings change Under Pop options to Yes. (I believe you already done it as per your pics)

Check if your outlook account has been blocked by an unusual activity, in that case, you may need to verify your account (via the assigned mobile#) and verify and review your activities (email should looks like below)

To help keep you safe, we've blocked access to your inbox, contacts list, and calendar for that sign‑in. Please review your recent activity and we'll help you secure your account. To regain access, you'll need to confirm that the recent activity was yours. Review recent activity Thanks, The Microsoft account team

In your settings.py change as below

EMAIL_HOST='smtp‑mail.outlook.com'
EMAIL_PORT=587
EMAIL_HOST_USER='your email'
EMAIL_HOST_PASSWORD='password'
EMAIL_USE_TLS=True
server = smtplib.SMTP('smtp.office365.com', 587) 
server.starttls()

finally make sure to import smtplib

(by gianlop3zRan)

參考文件

  1. SMTPAuthenticationError: Authentication unsuccessful [BL1PR13CA0128.namprd13.prod.outlook.com] in Django (CC BY‑SA 2.5/3.0/4.0)

#hotmail #API #Django #smtpclient #smtp






相關問題

dapatkan kontak aol menggunakan oauth api (get aol contacts using oauth api)

跟踪代理 Hotmail 後面的 IP 地址 (Track IP address behind proxy Hotmail)

Праблемы Hotmail і Outlook з радыёкнопкамі (Hotmail and Outlook issues with radio buttons)

Hotmail "kéo dài" chữ ký HTML / CSS không chính xác (Hotmail incorrectly "stretching" HTML/CSS signature)

向 hotmail 帳戶發送電子郵件 (Sending email to hotmail accounts)

如何在 openID 站點中使用 Microsoft 帳戶? (How to use Microsoft Account in an openID site?)

使用 CakePHP 導入電子郵件聯繫人 (Gmail Yahoo Hotmail) (Import email contacts (Gmail Yahoo Hotmail) using CakePHP)

通過 Java 訪問 Hotmail 未讀郵件計數 (Access Hotmail Unread Mail Count via Java)

SMTPAuthenticationError:Django 中的身份驗證不成功 [BL1PR13CA0128.namprd13.prod.outlook.com] (SMTPAuthenticationError: Authentication unsuccessful [BL1PR13CA0128.namprd13.prod.outlook.com] in Django)

Hotmail - HTML 電子郵件表格圖像間隙 (Hotmail - HTML Email Table image gap)

Yahoo、Gmail、Hotmail 和 AOL 是否有白名單? (Are there white lists for Yahoo, Gmail, Hotmail and AOL?)

hotmail集群數據存儲是如何工作的? (How does a hotmail cluster data storage work?)







留言討論