Skip to main content
 首页 » 编程设计

python之通过 ESMTP 发送邮件时出现 TLSRequired 错误

2024年08月29日34lovecherry

我用 twisted 实现了一个邮件发送器。它在 Ubuntu 上运行时没有任何错误,而当我尝试在 Windows 机器 (XP) 上运行它时,它给出了 TLSRequiredError。

我找不到满意的答案,帮助或意见将不胜感激。

这是错误的回溯:

2012-12-12 11:25:10,515 MailSender: Error occured while sending mail: [Failure instance: Traceback (failure with no frames): <class 'twisted.mail.smtp.TLSRequiredError'>: 502 Server does not support secure communication via TLS / SSL 
<<< 250-STARTTLS 
<<< 250-AUTH LOGIN PLAIN 
<<< 250-DSN 
<<< 250 ENHANCEDSTATUSCODES 

请您参考如下方法:

发生错误是因为在 Windows 机器上未安装 pyOpenSSL 模块。

当我安装 pyOpenSSL ,错误消失了。