【发布时间】:2017-01-17 07:13:51
【问题描述】:
我想使用“SendInBlue”发送交易和营销电子邮件。我也想用 Python 语言来做同样的事情。我访问了 SendInBlue 的 API 文档并遵循相同的程序,仍然无法发送电子邮件。
from mailin import Mailin
m = Mailin("https://api.sendinblue.com/v2.0","ScrWGqd296ya0CWq")
data = { "to" : {"aman@gmail.com":"to whom!"},
"from" : ["amandeep@gmail.com", "from email!"],
"subject" : "Subject...",
"html" : "This is the <h1>HTML</h1>",
"attachment" : ["https://example.com/path-to-file/filename1.pdf", "https://example.com/path-to-file/filename2.jpg"]
}
result = m.send_email(data)
print(result)
我还从 github 下载了 mailin-api-python 并运行了这个脚本。我不知道在哪里设置我的 smtp 详细信息。
**出于安全目的,我更改了 API 密钥。
【问题讨论】:
-
@garg10我可以通过包含代码部分来编辑我的问题。
-
您要设置哪些详细信息?部分 smtp 设置由get_smtp_details api 调用提供。
-
先生,您能否给我看一个使用 python 从 SendInBlue 发送活动邮件的示例脚本?
标签: python transactional-email sendinblue