1
我想使用sendgrid从我的Python应用程序发送电子邮件。使用sendgrid&python发送html /文本邮件的简单方法?
它发送精细使用邮件助手和语法如下:
sgmessage = mail.Mail(from_email, message.subject, to_email, content)
sg.client.mail.send.post(request_body=sgmessage.get())
但我找不到要发送的与文本& HTML版本中的multipart/alternative的内容类型的电子邮件的方式吗?
我已经试过这样的事情:
sgmessage = mail.Mail(from_email, message.subject, to_email)
sgmessage.add_content(content)
sgmessage.add_content(htmlcontent)
但是,这给了我错误的请求时,我尝试发送。
可能有人点我的文档或其它尖实现这一目标?
而且附件 - 我无法找到该邮件很方便的辅助,这将有助于我添加附件的能力,以我的代码文档。