Python client for Mailgun Api V2
mailgun2的Python项目详细描述
最初位于https://github.com/ZeroCater/python-mailgun2
用于与 Mailgun。当前只支持发送 信息。技术支持 Requests。
与Python3一起工作!
安装
pip install mailgun2
用法
frommailgun2importMailgunmailer=Mailgun('example.mailgun.org','public_key','private_key')mailer.send_message('from@yourdomain.com',['to@you.com','others@you.com'],subject='Hi!',text='Sweet.')
必需参数:
from_email: string of email address to set as sender to: list or string of email address to send to
可选参数:
subject: string subject of the email text: string body of the email. Either text or html is required. html: string HTML of the email. Either text or html is required. cc: list of cc addresses. bcc: list of bcc addresses. tags: list of mailgun tags to associate with the email. reply_to: Convenience argument for setting the Reply-To header headers: Extra headers for messages inlines: List of file paths to attach inline to the message attachments: List of (file name, content type, file handle) as a multipart attachment