Mutt is a Command Line Email Client to Send Mails from Terminal.
To install mutt:
$ sudo apt-get install mutt
Configure Mutt
Create
mkdir -p ~/.mutt/cache/headers
mkdir ~/.mutt/cache/bodies
touch ~/.mutt/certificates
Create mutt configuration file muttrc
touch ~/.mutt/muttrc
Open muttrc
nano ~/.mutt/muttrc
And to configure mutt with gmail, you have to add the following file ~/.muttrc:
# A basic .muttrc for use with GMail
#Gmail account details
set imap_user = "oscargomezf@gmail.com"
set imap_pass = "****"
set smtp_url = "smtp://oscargomezf@smtp.gmail.com:587/"
set smtp_pass = "****"
set from = "oscargomezf@gmail.com"
set realname = "Oscar Gomez Fuente"
# Editor
set editor = "nano"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent Mail"
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set move = no
set imap_keepalive = 900