使用IMAPClient如何查看邮件正文和发件人电子邮件地址?
server = IMAPClient(imap_server, use_uid=True, ssl=ssl)
server.login(imap_user, imap_password)
print 'login successful'
select_info = server.select_folder('INBOX')
print '%d messages in INBOX' % select_info['EXISTS']
messages = server.search(['NOT DELETED'])
print "%d messages that aren't deleted" % len(messages)
print
print "Messages:"
response = server.fetch(messages, ['FLAGS', 'RFC822.SIZE'])
for msgid, data in response.iteritems():
print ' ID %d: %d bytes, flags=%s' % (msgid,
data['RFC822.SIZE'],
data['FLAGS'])