Properly formatted example for Python iMAP email access?

前端 未结 4 1982
故里飘歌
故里飘歌 2021-02-01 09:57

tldr: Can someone show me how to properly format this Python iMAP example so it works?

from https://docs.python.org/2.4/lib/imap4-example.html

<         


        
4条回答
  •  Happy的楠姐
    2021-02-01 10:30

    Did you forget to specify the IMAP host and port? Use something to the effect of:

    M = imaplib.IMAP4_SSL( 'imap.gmail.com' )
    

    or,

    M = imaplib.IMAP4_SSL()
    M.open( 'imap.gmail.com' )
    

提交回复
热议问题