Mutt is a powerful text email client that can be used to access Gmail over IMAPS. Here are the relevant settings for your .muttrc.
Enable header caching
set header_cache=~/.mutt_cache
Configure IMAP over SSL
set from="FNAME LNAME <USERNAME@gmail.com>"
set imap_user=USERNAME@gmail.com
set imap_pass=PASSWORD
set folder=imaps://imap.gmail.com
set spoolfile=imaps://imap.gmail.com/INBOX
set record=imaps://imap.gmail.com/Sent
set postponed=imaps://imap.gmail.com/Drafts
set timeout=10
set mail_check=5
mailboxes =INBOX
Configure SMTP AUTH over SSL
set smtp_url="smtps://USERNAME\@gmail.com:PASSWORD@smtp.gmail.com/"