我正在学习使用django python的sendgrid api。目前,我可以成功地发送电子邮件,但我想使电子邮件更具吸引力,并应用一些css样式。我在网上找人帮忙,但找不到。有人能告诉我该怎么做吗?你知道吗
这就是我目前所尝试的
def sendemail(sender,recipient,subject,content,url):
sg = sendgrid.SendGridAPIClient(apikey="*****")
from_email = Email(sender)
to_email = Email(recipient)
subject = subject
content = Content("text", content+url)
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
print(response.status_code)
print(response.body)
print(response.headers)
目前没有回答
相关问题 更多 >
编程相关推荐