The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-16-2008
npatwardhan npatwardhan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 135
Here is something you can try..
  • <LI class=MsoNormal style="mso-list: l0 level1 lfo1">Create one file called message.txt which has the body of the email message. <LI class=MsoNormal style="mso-list: l0 level1 lfo1">Create the attachment file. Lets call it attachment_file.txt
  • Now use the following commands:
/usr/bin/uuencode attachment_file.txt email_attachment.lst > attachment.txt

#concatenate message.txt and attachment.txt into combined.txt


cat message.txt attachment.txt > combined.txt

#email combined.txt file. this file has the body of the email and the attachment

mail -s "Message with Attachment" <YOUR EMAIL> < combined.txt