gpt4 book ai didi

python - Django SMTPServerDisconnected : Connection unexpectedly closed using Postfix on Centos

转载 作者:行者123 更新时间:2023-12-04 19:37:32 28 4
gpt4 key购买 nike

我已经在 Centos 7 上安装了 Postfix,并成功将其配置为发送邮件(用命令行程序 MailX 测试)。

但是,当尝试通过 Django shell 或我的 Django 网站发送邮件时,我得到:

File "/usr/lib64/python2.7/smtplib.py", line 367, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed

我在 settings.py 中的邮件配置:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'Admin <admin@mywebsite.com>'

有任何想法吗?

最佳答案

邮件日志突出显示:

fatal: no SASL authentication mechanisms



解决方法:
yum install cyrus-sasl-plain

关于python - Django SMTPServerDisconnected : Connection unexpectedly closed using Postfix on Centos,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38353089/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com