服务器不支持STARTTLS扩展 [英] STARTTLS extension not supported by server

查看:74
本文介绍了服务器不支持STARTTLS扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个重复的问题,但是我仍然面临着这个问题,希望能有一个解决方案.预先感谢.

This maybe a repeated question but I'm still facing issues on this, hope there's a solution around. Thanks in advance.

我正在尝试通过公司的服务器发送邮件

I'm trying to send mail through the company's server

我当前正在使用Python版本2.6和Ubuntu 10.04

I'm currently using Python version 2.6 and Ubuntu 10.04

这是我收到的错误消息

Traceback (most recent call last):

  File "hxmass-mail-edit.py", line 227, in <module>
    server.starttls()

  File "/usr/lib/python2.6/smtplib.py", line 611, in starttls
    raise SMTPException("STARTTLS extension not supported by server.") smtplib.SMTPException: STARTTLS extension not supported by server.

这是代码的一部分

server = smtplib.SMTP('smtp.abc.com', 587)
server.set_debuglevel(1)
server.ehlo()
server.starttls()
server.ehlo()
server.login('sales@abc.com', 'abc123')
addressbook=sys.argv[1]

推荐答案

starttls()之前删除 ehlo().

starttls()+ ehlo()导致两条HELLO消息,这导致服务器删除了回复消息中的 STARTTLS .

starttls() + ehlo() results in two HELLO messages, which cause the server remove the STARTTLS in the reply message.

server = smtplib.SMTP('smtp.abc.com', 587)
server.starttls()
server.ehlo()
server.login('sales@abc.com', 'abc123')

这篇关于服务器不支持STARTTLS扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆