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

Using sendmail to send a file

Status
Not open for further replies.

Ati2ude

Programmer
Dec 11, 2001
79
US
I am trying to do something with KSH that I am not sure will work. I want to determine if a file is zero byte, if not attach it to an e-mail and send it to myself.

I have used the sendmail prog before but not in this depth.

Example of what I have done:
/usr/sbin/sendmail -f$from -t < $mailfile >/dev/null

Any help would be appreciated.

Ati2ude
 
[ -s $mailfile ] && echo "$mailfile not empty" ]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the quick reply!

So is this syntax correct??
/usr/sbin/sendmail -f$from -s$myfile -t < $mailfile >/dev/null

$mailfile = a log I have compiled thru-out the script to write the text to the e-mail.

$myFile = the file I want to send to the myself.

Ati2ude
 
man sendmail

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top