Zmail允许您在python中尽可能发送和接收电子邮件。无需检查服务器地址或制作您自己的MIME对象。使用zmail,您只需要关心您的邮件内容。
Zmail只在python3中运行,不需要第三方模块。不支持python2
import zmail
# help(zmail)
mail = {
'subject': 'Success!', # Anything you want.
'content_text': 'This message from zmail!', # Anything you want.
# 'attachments': ['/Users/zyh/Documents/example.zip','/root/1.jpg'], # Absolute path will be better.
}
server = zmail.server('yourmail', 'password')
server.send_mail('to mailadrss', mail)