We all are familiar with “mail” command in most of the linux/unix platform. We can easily send email from command-line using “mail” command. Also we can use this command to
1. Check the emails to a user box.
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 7 messages 7 unread
>U 1 root@conn-web05. Fri Jul 29 07:04 31/1154 "Cron <root@finaconn-w"
U 2 logwatch@fonn-we Sat Jul 30 07:03 140/5121 "Logwatch for finaconn"
U 3 root@conn-web05. Sat Jul 30 07:04 31/1154 "Cron <root@finaconn-w"
U 4 logwatch@conn-we Sun Jul 31 07:03 100/3816 "Logwatch f
Type the no. shown on the right side of the line to read that mail. Also you may use d start.no – end.no command to delete the email.
2. How to send a test email
You may verify the email delivery by checking the mail log
#tail -f /var/log/maillog” check the last few lines
Now come back to mutt program. It’s a simplest program which having a capable to send out attachment along with the email. This will be useful if you have to send some errors in application and send the error in detailed to the dev. team using a script.
3. Sending email using mutt with attachment
4. Mutt with multiple attachment and email address.
if you have multiple senders and attachments
6. If you wish to send email as a HTML email.
You may also change the from address, reply to address where all the email send out using “mutt” program.
7. Change mutt profile values and from headers.
You may see a file in your home directory “~/.muttrc“. Content will be looks like as follows,
# Mutt sender profile: default
# location cd ~
# Signature file
# Customized headers
unmy_hdr * # remove all extra headers first.
my_hdr From: Web-05 Exception checker <email@example.com>
my_hdr Reply-To: root <firstname.lastname@example.org>
8. Send a test mail from a file content