Search This Blog

Sunday, November 07, 2010

How to attach a pdf file to an email from a shell script

Write the following shell script ,

---
echo "Training Calendar on ` date +%d-%b-%Y` " > /tmp/mailmessage.txt
wget -O /tmp/blr.pdf http://xxx.xxxx.xxx.com/test.pdf
mutt -s "Training Calendar on ` date +%d-%b-%Y` " -a /tmp/trg_blr.pdf ravi.reddy@oracle.com < /tmp/mailmessage.txt
---

To change the from email address while using mutt
create a .muttrc in the users home directory if it doesnot exist, then enter the feild

set realname="ravi.reddy@oracle.com" this will change the name in the senders name .

No comments: