import smtplib from email.header import Header from email.mime.text import MIMEText server = smtplib.SMTP(‘smtp.163.com‘, 25) server.login(‘[email protected]‘, ‘LBQ139196‘) msg = MIMEText(‘hello, send by Python...‘, ‘plain‘, ‘utf-8‘) msg[‘From‘] = ‘[email protected] <[email protected]>‘ msg[‘Subject‘] = Header(u‘text‘, ‘utf8‘).encode() msg[‘To‘] = u‘飞轮海 <[email protected]>‘ server.sendmail(‘[email protected]‘, [‘[email protected]‘], msg.as_string())
时间: 2024-10-03 18:47:42