Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing email messages using Unix mail

Status
Not open for further replies.

lane78

Programmer
Oct 10, 2001
9
MY
Hi all,
A shell script file named 'send_report' contains this segment
...
uuencode $aimfilels $aimfilels | mail -s "Report" $userid@email.com
...

The command mail-s is used to specify the email subject, $aimfilels = attachment file
$userid = username. My question is, how do I add the email message text into this script?



 
what about:

uuencode $aimfilels $aimfilels | mail -s &quot;Report&quot; $userid@email.com < file.txt

I haven't tried this.... Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Hi Mike,

Thanks for the reply.
Your approach is to attach the message .txt form.. which is exactly the mechanism i've been using (aimfilels attachment is the message file) all this while. If you have any idea on how to add the message directly into the script, pls let me know, because the above method does not work. Your help will be very much appreciated.


Thank you..
lane
 
try this

(echo &quot;text in body&quot;;uuencode /tmp/file-to-attach file.txt)|mailx -s &quot;subject text&quot; lane78@somewhere.com

crowe
 
ok, interesting - does that work lane78? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top