品易云推流 关闭
文章详情页
文章 > Python基础教程 > python中有哪些邮件模块

python中有哪些邮件模块

python邮件

头像

小妮浅浅

2021-10-15 10:09:334124浏览 · 0收藏 · 0评论

1、yagmail模块用于发邮件模块。

2、keyring模块可以访问系统密钥环服务。

3、schedule模块用于定时任务执行器。

4、inbox模块的IMA包进行IMAP操作。

实例

import yagmail
username = 'xxxxxx@beegee.org'
password = 'xxxxx'
smtp = 'smtp.exmail.qq.com'
mail = yagmail.SMTP(user=username,password=password,host=smtp)
 
to = ['69xxxxxxx@qq.com']
cc = ['69xxxxxxx@qq.com']
subject = '发红包!'
content = '发红包!'
files = [r'D:\test\第一课\01.txt',r'D:\test\第一课\02.txt']
mail.send(to=to,cc=cc,subject=subject,contents=content,attachments=files)

以上就是python中邮件模块的介绍,希望对大家有所帮助。更多Python学习指路:python基础教程

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图