Tuesday, June 4, 2013

Sending EMAIL & MAIL Attachment from Shell Script/Unix Command

Sending mail without attachment

echo "Success Mail content" | mailx -s "Test mail" tgkq36@gmail.com

Sending mail with single attachment

uuencode <file.pdf>  <file.pdf> | mailx –s “Test Mail” tgkq36@gmail.com  <  body_content_file

Sending mail with multiple  attachment

uuencode <file.pdf > <sample1.pdf>    > data
uuencode <file2.pdf>  <sample2.pdf >  >> data
echo “Success “ >> data


Change the sender/from mail address

mailx –s “Test Mail” tgkq36@gmail.com -- -r “sendearmailaddress” ~c “ccaddres” < data


Mutt options :

mutt -s "Test mail" -a <NewDoc.pdf>  tgkq36@gmail.com < body_content_file

b address  (bcc)
c address (cc)
Note : multiple mail address separated by comma

No comments:

Post a Comment

Customer Tax Registration - EBS Query

              SELECT DISTINCT  hp.party_type, hp.party_name, hca.account_name, hp.party_number, hps.party_site_number, ...