/django/core/mail.py
源文件(行:65):
修改为:
为了解决我的 qmail 服务器 ESMTP 身份验证的问题。
源文件(行:65):
try:
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
if auth_user and auth_password:
server.login(auth_user, auth_password)
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
if auth_user and auth_password:
server.login(auth_user, auth_password)
修改为:
try:
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
server.ehlo()
if auth_user and auth_password:
server.esmtp_features["auth"] = "LOGIN PLAIN"
server.login(auth_user, auth_password)
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
server.ehlo()
if auth_user and auth_password:
server.esmtp_features["auth"] = "LOGIN PLAIN"
server.login(auth_user, auth_password)
为了解决我的 qmail 服务器 ESMTP 身份验证的问题。
本文解决了使用Django发送邮件时遇到的qmail服务器ESMTP身份验证问题,通过修改SMTP连接设置,确保了身份验证过程正确进行。

被折叠的 条评论
为什么被折叠?



