好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

yagmail 报错SSL WRONG_VERSION 的坑

发送邮件

邮箱使用25 端口发送邮件,yagmail 报错 SSL WRONG_VERSION ???? 一头雾水,后面换成465 端口就正常了。不知道操作,后续看源码研究下

   def send_mail(self ,file):
        # 链接邮箱服务器
        password = ""
        user = ""
        yag = yagmail.SMTP(user=user, password=password, host='smtp.qq测试数据', port='465')

        # 邮箱正文
        contents = []
        contents.append("{元素,出现差异")
        contents.append(file)
        # 发送邮件
        yag.send(to=to, subject='subject', contents=contents) 

查看更多关于yagmail 报错SSL WRONG_VERSION 的坑的详细内容...

  阅读:27次