邮箱使用25 端口发送邮件,yagmail 报错SSL WRONG_VERSION
????
一头雾水,后面换成465 端口就正常了。不知道操做,后续看源码研究下服务器
def send_mail(self ,file): # 连接邮箱服务器 password = "" user = "" yag = yagmail.SMTP(user=user, password=password, host='smtp.qq.com', port='465') # 邮箱正文 contents = [] contents.append("{元素,出现差别") contents.append(file) # 发送邮件 yag.send(to=to, subject='subject', contents=contents)