python实用功能之001-邮件发送

import yagmail

#链接邮箱服务器
yag = yagmail.SMTP( user="wangjian@stcpay.com", password="passok", host='smtp.exmail.qq.com', port=465)

# 邮箱正文
contents = ['This is the body, and here is just text http://somedomain/image.png',
            'You can find an audio file attached.', '/local/path/song.mp3']

# 发送邮件
yag.send('wangjian@stcpay.com', 'subject', contents)

 

posted @ 2020-12-17 11:03  紫电清霜  阅读(68)  评论(0编辑  收藏  举报