使用“SendInBlue”发送交易和营销电子邮件

2024-06-16 13:36:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用“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下载了mailinapi python并运行了这个脚本。我不知道在哪里设置我的smtp详细信息。在

**我只是出于安全目的更改了密钥。在


Tags: topathfromhttpscomdataexample电子邮件