标签:
1.使用python 写发邮箱代码:
def sendmail (): import smtplib from email.mime.text import MIMEText from email.utils import formataddr msg = MIMEText(‘邮件内容‘, ‘plain‘, ‘utf-8‘) msg[‘From‘] = formataddr(["发件人名", ‘发件人地址‘]) msg[‘Subject‘] = "主题" server = smtplib.SMTP("发件人邮箱SMTP地址", 25) server.login("发件人邮箱地址", "发件人邮箱登录密码") server.sendmail(‘发件人地址‘, [‘送件人地址‘, ], msg.as_string()) server.quit() sendmail()
标签:
原文地址:http://www.cnblogs.com/itusye/p/5638864.html