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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailx, HP-UX attachment, subject, message body 1

Status
Not open for further replies.

kossta

Technical User
Feb 2, 2011
1
EU
=================================================================

I have search for some time to find a solution, to use mailx to send automated email from UNIX, which includes an attachment, subject and a message body text. It was hard to find solution, but finally fiddling with mailx the solution was simple:

BODY=<path to file with body message>
MAIL="<list of recipients>"
SUBJECT="<your subject>"
yourattachment=<path to the file to attach>

(uuencode $yourattachment yourattachment.txt;echo "`cat $BODY`") | mailx -m -s "$SUBJECT" -r noreply@domain.com $MAIL;

I hope this is helpful.

=================================================================

 
Thanks for the tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top