以下是我的代码及返回信息,163和qq的都尝试过但都是验证错误,密码什么的我肯定是没有输错的。
代码:
#-*- encoding: utf-8 -*-
import os, sys
import smtplib
from smtplib import SMTP_SSL
from email.header import Header
from email.mime.text import MIMEText
mailInfo = {
"from": "xxx@qq.com",
"to": "yyy@163.com",
"hostname": "smtp.qq.com",
"username": "xxx@qq.com",
"password": "*********",
"mailsubject": "this is test",
"mailtext": "hello, this is send mail test.",
"mailencoding": "utf-8"
}
if __name__ == '__main__':
smtp = SMTP_SSL(mailInfo["hostname"])
smtp.set_debuglevel(1)
smtp.ehlo(mailInfo["hostname"])