我试图通过imaplib连接到我的邮件服务器,并在构造函数中得到了一个错误:我的代码:
import imaplib
imaplib.IMAP4_SSL('my_host.com', 1234)错误:
Traceback (most recent call last)
/home/username/www/site/<ipython console> in <module>()
/usr/lib/python2.7/imaplib.py in __init__(self, host, port, keyfile, certfile)
1163 self.keyfile = keyfile
1164 self.certfile = certfile
-> 1165 IMAP4.__init__(self, host, port)
1166
1167
/usr/lib/python2.7/imaplib.py in __init__(self, host, port)
197 self.state = 'NONAUTH'
198 else:
--> 199 raise self.error(self.welcome)
200
201 typ, dat = self.capability()
error: NonePython接收来自服务器的响应,然后引发错误,但这是一个正常的延续响应。来自服务器的响应:
+OK my_host.com POP3 MDaemon 12.5.6 ready <MDAEMON-F201406061147.AA472534MD1387@my_host.com>我应该怎么做才能从我的服务器收到我的邮件?
发布于 2014-06-06 08:41:44
恶魔指出他使用的是POP3协议。你想和他用IMAP协议沟通。将lib更改为poplib或更改端口以通过IMAP协议进行通信(默认为143)。
https://stackoverflow.com/questions/24077420
复制相似问题