imapobj select_folder('inbox'readonly=trueuids imapobj search(['since -jul- ']uids [ rawmessages imapobj fetch([ ]['body[]''flags']import pyzmail message pyzmail pyzmessage factory(rawmessages[ ][ 'body[]']message get_subject('hello!message get_addresses('from'[('edward snowden''esnowden@nsa gov')message get_addresses('to'[('jane doe''jdoe@example com')message get_addresses('cc'[message get_addresses('bcc'[message text_part !none true message text_part get_payload(decode(message text_part charset'follow the money \ \ \ \ -ed\ \nmessage html_part !none true message html_part get_payload(decode(message html_part charset'so longand thanks for all the fish!al\ \nimapobj logout(you don' have to memorize these steps after we go through each step in detailyou can come back to this overview to refresh your memory connecting to an imap server just like you needed an smtp object to connect to an smtp server and send emailyou need an imapclient object to connect to an imap server and receive email first you'll need the domain name of your email provider' imap server this will be different from the smtp server' domain name table - lists the imap servers for several popular email providers table - email providers and their imap servers provider imap server domain name gmailimap gmail com outlook com/hotmail comimap-mail outlook com yahoo mailimap mail yahoo com at& imap mail att net comcast imap comcast net verizon incoming verizon net *additional security measures prevent python from being able to log in to these servers with the imapclient module sending email and text messages