码迷,mamicode.com
首页 > 其他好文 > 详细

emailz-使发送邮件更方便

时间:2020-04-20 15:59:36      阅读:63      评论:0      收藏:0      [点我收藏+]

标签:imp   pre   end   mapping   file   The   tab   ***   password   

emailz

easy use for send emails

Install

pip install emailz

Simple Use

from emailz import email

email.config(user=‘ivan-me@163.com‘,password=‘***‘)
email.send(subject=‘Test‘, body=‘hi,\n,it‘s a test‘,receivers=[‘han_zhichao@sina.cn‘])

Use HTML

email.send(subject=‘Test‘, html=‘<h2>hi,it‘s a test</h2>‘,receivers=[‘han_zhichao@sina.cn‘])

Use Template file

email.send(subject=‘Test‘, template=‘tpl.html‘,receivers=[‘han_zhichao@sina.cn‘])

With attachments

email.send(subject=‘Test‘, attachments=[‘tpl.html‘],receivers=[‘han_zhichao@sina.cn‘])

ToDo

  • Smtp Server mapping
  • @email decorators
  • trigger, crontab or more features
  • theme and templates to choose

emailz-使发送邮件更方便

标签:imp   pre   end   mapping   file   The   tab   ***   password   

原文地址:https://www.cnblogs.com/superhin/p/12737953.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!