我正在使用 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))
Eventhought,我已经设置了subjet
,我仍然收到没有主题的电子邮件。此外,我的应用程序运行时没有任何错误。