Tuesday, December 30, 2008

How send email attachments from a command prompt?

With Mutt tool you can perform this task.

Make sure Mutt RPM are installed on your systems.

Use following command to check RPM.

#rpm -qa | grep mutt

You can check the status.


Now...... Use following command to send a attachment file.

# mutt -s "Test mail" -a /root/install.log raman36127@gmail.com < /tmp/mailmessage.txt


:--raman36127@gmail.com - is the recipient
:--/tmp/mailmessage.txt - is the main body of the e-mail (read message from the file "mailmessage.txt")
:--/root/install.log - is an attachment (with option -a)
:-- "Test mail" - is a subject line (option -s)

Hope this work for you.............

Enjoy.............