首先Python导入smtp模块和email.mime.text import MIMEText
sender = “xxx@163.com” password="zzz"
receiver = "yyy@163.com"
Mail_Host = "smtp.163.com"
message = MIMEText(content,_subtype="plain",_charset="utf-8")//定义发送文本的格式
message['Subject'] = sub
message[‘From’]=user
message['To']=";".join(receiver)
server=smtplib.SMTP(Mail_Host,25) /server=smtplib.SMTP server.connect(Mail_Host,25) 使用这两种方法链接SMTP
server.login(sender,password)
server.sendmail(sender,receiver,message.as_string())
server.close()
若产生550错误的话应该是得将邮箱进行授权,将@163.com->设置->客户端密码授权