python 发送邮件总是失败

最近部署了GSIL github敏感信息扫描 工具,扫描后无法发送邮件。
GSIL项目地址:https://github.com/FeeiCN/GSIL
提示的错误信息如下:

clipboard.png

Traceback (most recent call last):
  File "/usr/lib/python3.6/smtplib.py", line 387, in getreply
    line = self.file.readline(_MAXLINE + 1)
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/GSIL/gsil/notification.py", line 67, in notification
    s.ehlo()
  File "/usr/lib/python3.6/smtplib.py", line 441, in ehlo
    (code, msg) = self.getreply()
  File "/usr/lib/python3.6/smtplib.py", line 391, in getreply
    + str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: [Errno 104] Connection reset by peer

请问各位大佬遇见过这种问题吗?google了也没找到相关的解决办法,请各位大佬指教。谢谢。

阅读 5.1k
2 个回答

换其他邮件服务器试试?

只遇到过使用的邮箱不能连接的问题,一般是端口和邮箱协议配置错误,或者是网络中有防火墙不允许访问,或者是系统环境缺少了什么必要的包

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题