python操作gmail
import imaplib, re class pygmail( object ): def __init__( self ): self .IMAP_SERVER = 'imap.gmail.com' self .IMAP_PORT = 993 self .M = None self .response = None self .mailboxes = [] def login( self , username, password): self .M = imaplib.IMAP4_SSL( self .IMAP_SERVER, self .IMAP_PORT) rc, self .response = self .M.login(username, password) return rc def get_mailboxes( self ): rc, self .response = self .M. list () for item in self .response: self .mailboxes.append(item.split()[ -...