import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
smtp = smtplib.SMTP_SSL(host='smtp.163.com', port=465)
smtp.login(user='xxxxxxx@163.com', password='NUEIVEXIASIFCETF')
msg = MIMEMultipart()
msg['From'] = "xxxxxx@163.com"
msg['To'] = "xxxxxxxx@qq.com>"
msg['Subject'] = Header("成功", charset='utf8')
text_content = MIMEText("真好,是真的。", _charset='utf8')
msg.attach(text_content)
smtp.send_message(msg=msg, from_addr="xxxxxxx@163.com", to_addrs="xxxxxx@qq.com")
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24