![](/img/trans.png)
[英]imaplib - What is the correct folder name for Archive/All Mail in Gmail?
[英]Imaplib Select Fails while connecting folder(**Labelname) of gmail
我使用imaplib模塊連接到Gmail Imap,我收到了下面提到的錯誤。 我正在使用select命令進行連接
Labelname is **LabelName
我收到此錯誤:
resp, data = self._imap.select("**LabelName")
File "/usr/lib/python2.6/imaplib.py", line 642, in select
typ, dat = self._simple_command(name, mailbox)
File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python2.6/imaplib.py", line 895, in _command_complete
raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SELECT command error: BAD ['Could not parse command']
而如果Labelname是
** LabelName
它成功連接。
誰能告訴我這里發生了什么?
找出問題,使用imaplib進行連接時我們需要像這樣連接:
imapobj.select('"'+ '**Foldername' + '"')
這樣結果就像這樣選擇
"**Foldername"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.