mail_pass="授权密码"#口令 sender='liuchunlin202205@163.com'receivers= ['liuchunlin202205@163.com'] # 接收邮件,可设置为你的QQ邮箱或者其他邮箱 message= MIMEText('Python 邮件发送测试...','plain','utf-8') message['From'] = Header("菜鸟教程",'utf-8') message['To'] = Header("测试",...
Server="smtp.163.com"# 163邮箱的SMTP服务器地址Subject="Test email from Python"# 邮件主题To="429191942@qq.com"# 收件人From="xpleaf@163.com"# 发件人Text="This is the email send by xpleaf, from xpleaf@163.com!"# 邮件内容Body='\r\n'.join(("From: %s"%From,"To: %s"%To,"Subject...
3.编写发送邮件代码 这里参考菜鸟教程的Python SMTP发送邮件 1.首先去QQ邮箱 打开 设置-账户-开启服务-开启POP3/SMTP服务,然后点击生成授权码,python发送邮件要用。 直接上代码,不解释。 # 简单邮件传输协议 import smtplib import email import time from email.mime.text import MIMEText from email.mime.image im...