【发布时间】:2020-05-19 06:34:23
【问题描述】:
我使用的 Django / Sendgrid / Heroku 设置运行良好,但没有明显原因停止。
我的 Django 设置:
EMAIL_HOST="smtp.sendgrid.net"
EMAIL_HOST_PASSWORD="..."
EMAIL_HOST_USER="..."
EMAIL_PORT=587
EMAIL_USE_TLS=True
使用此设置,如果我使用 django 库发送简单的电子邮件...
from django.core.mail import send_mail
send_mail(
'Subject here',
'Here is the message.',
from_email_address,
[to_email_address],
fail_silently=False,
)
我收到此错误
--> SMTPServerDisconnected: Connection unexpectedly closed
我仍然可以使用 sendgrid python 库发送电子邮件
import sendgrid
sg = sendgrid.SendGridAPIClient(apikey)
sg.send(data)
我有什么遗漏吗?
【问题讨论】:
-
你能告诉我们你的 sendgrid 包的当前版本是什么吗?
-
6.3.1 但我没有在生产中使用 sendgrid 包,我只是尝试测试它是否与我的 sendgrid 价格计划有关
标签: django heroku sendgrid django-email