Ask HN: How to send GMail from command line?
There is a utility called ghi that opens and lists github issues from command line. Is there anything that has a similar interface to send and list GMail?
http://www.binarytides.com/linux-mail-with-smtp/
As for listing your inbox and folders, searching for a command line IMAP client should net you something as well.
Mutt can easily be set up to fetch mails from gmail via smtp.
set from='me@gmail.com'
set imap_user='me@gmail.com'
set folder=imaps://imap.gmail.com/
set smtp_url=smtp://$from@smtp.gmail.com:587
Mutt can send mails both interactively and non-interactively. echo non-interactive | mutt you@gmail.com -c cc@gmail.com -s 'greeting'