The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
To send an email with the body content extracted from a file rohit.shetty84 UNIX for Dummies Questions & Answers 3 05-11-2008 08:32 PM
Command line/Script to send E-mail with HTML body and binary attachment G-Man AIX 3 04-18-2007 06:30 PM
AIX send mail with HTML message body and a binary attachment G-Man UNIX for Dummies Questions & Answers 4 03-22-2007 11:15 AM
script that will send and email attachment davels Shell Programming and Scripting 2 01-01-2005 02:44 AM
Send Mail with attachment and a body manojram How do I send email? 4 04-26-2004 08:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-28-2006
Registered User
 

Join Date: Sep 2006
Posts: 27
Thumbs down how to send an email with some body content and attachment

hi
plz help me in sending a mail with some data in body and an attachment as some txt file.
currently i am able to send mail with some body content, i need an example how to send the same along with attachment.
thanks in advance
-bali
Reply With Quote
Forum Sponsor
  #2  
Old 11-28-2006
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
check the FAQ section
Reply With Quote
  #3  
Old 08-20-2008
Registered User
 

Join Date: Jul 2008
Posts: 3
Try this

(echo "$CONTENT \n"\
; uuencode $ATTACH_OUTPUT_FILE $ATTACH_FILE_NAME)\
| mail -s "$SUBJECT" "$MAIL_ADD"

Here CONTENT is the content of the file
CONTENT="Hi All, PFA the file"
ATTACH_OUTPUT_FILE is the file name along with path on disk
ATTACH_OUTPUT_FILE="/tmp/records.dat"
ATTACH_FILE_NAME is the file name you want to appear in the mail.
ATTACH_FILE_NAME="Employee Records.txt"
SUBJECT is subject of your mail
MAIL_ADD is the mail address.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0