「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 キーを変更しました。