Hello, I am using the following mailx command wich works well. I want to also include output from a log file in the mail body. How can this be done?
echo `date +"%m/%d/%Y %T"` "$P: The Purge Routine Has Started." | mailx -s "The Purge RoutineHas Started: `date`" $EMAIL
This script is sending it's output to PurgeArchiveDir.out, which I want to include as output in the body of the mail.
Thank you.
David
easiest way without too much of code change would be :
uuencode PurgeArchiveDir.out PurgeArchiveDir.out|mailx -s "`date +%m/%d/%Y %T` $P: The Purge Routine Has Started." $EMAIL
This would put the purge has started message in the subject and attach the logfile ...
Hope this helps ....
Vj
Vj, I will try this. Thank you very much for your input.
David
bd_joy
4
Here is also a reference to having both a body and an attachment in an e-mail:
http://www.unix.com/how-do-i-send-email/13766-send-mail-attachment-body.html