【发布时间】:2021-08-07 19:49:21
【问题描述】:
我正在使用 Sendgrid API 发送电子邮件,但我发送的每封电子邮件都没有 Subjet。
我的代码如下所示:
def send_notification(sendgrid_key, p_email):
message = Mail(
from_email=('my_email@mail.com'),
to_emails=(p_email),
subject='subject email',
)
message.template_id = 'XXXXXX'
try:
sg = SendGridAPIClient(sendgrid_key)
response = sg.send(message)
except Exception as e:
print(str(e))
Eventthought,我已经设置了subjet,我仍然收到没有主题的电子邮件。此外,我的应用程序运行时没有任何错误。
【问题讨论】:
-
您使用的是哪个版本的 SendGrid python 库?
-
我一直在使用 sendgrid 6.7.1
标签: python sendgrid sendgrid-api-v3 sendgrid-templates