一、使用qq郵箱接收和發送郵件
1、程序代碼:
smtplib email.mime.text MIMEText _user = _pwd = _to = msg = MIMEText() #郵件內容 msg[] = msg[] = _user #發送者郵箱 msg[] = _to #接收者郵箱 : s = smtplib.SMTP_SSL(,) #使用SSL s.login(_user,_pwd) #登陸 s.sendmail(_user,_to,msg.as_string()) #發送郵件 s.quit() smtplib.SMTPException,e: %e |