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)
原文地址:https://www.cnblogs.com/zhidian2020/p/14148479.html