Install mutt by using the following command:
Now create the base directories and a file using:
Use the following muttrc file, especially for Gmail:
Modify it to according to your credentials and place it in the home folder (~/).
Now you can execute mutt simply using:
For those who have enabled two-step verification in Gmail, directly entered password or written in muttrc will not work. You have to create an App password (https://security.google.com/settings/security/apppasswords) and enter the given password in your muttrc. Then it will work.
Although, it is not recommended to write your passwords in muttrc. You should set up gpg keys. For this refer to: https://wiki.archlinux.org/index.php/Mutt