[英]python 2.7 imaplib error
我試圖通過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: None
Python從服務器接收到響應,然后引發錯誤,但這是正常的繼續響應。 來自服務器的響應:
+OK my_host.com POP3 MDaemon 12.5.6 ready <MDAEMON-F201406061147.AA472534MD1387@my_host.com>
我應該怎么做才能從服務器接收郵件?
惡魔點,他使用協議POP3。 您正在嘗試使用IMAP協議與他進行交流。 將lib更改為poplib或將端口更改為通過IMAP協議進行通信(默認值為143)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.