通过python 的代码实现对email的操作,包括发送邮件和读取邮件。
import poplib
import smtplib
from email.header import decode_header
from email.mime.text import MIMEText
import email
# how to log in email
# for purpose to select to send or log in the email
# use SMTP to log in , use POP to accept
sent = smtplib.SMTP('smtp.163.com')
sent.login("13117890408@163.com","********")
# send the email
to = ['13117890408@163.com','1048845626@qq.com']
content = MIMEText('you are succeed !')
content['Subject'] = 'perfect'
content['From'] = '13117890408@163.com'
content['TO'] = ','.join(to)
sent.sendmail('13117890408@163.com',to,content.as_string())
sent.close()