Mailing A File On Tch Servers

windows

Guest
I've worked out a shell script which collects various information, parses it a bit with grep and a few other standard commands, and spits out a file called 'error.log' which, if it contains anything, needs to be e-mailed to an address of my choosing along with the unparsed file. Both files are plain text, and don't need to be actually attached to the message - they just need to be printed in the body.<br /><br />I've played around with sendmail a bit, tried piping in my file with the 'proper' header, but can't quite get it to shoot the e-mail off.<br /><br />Does anyone know a good way to do this, or even better have a small code snippet to show how to do this? I know it's fairly simple, I'm probably just missing something small.<br /><br />Thanks for any help.<!--content-->
Oh, I also tried to create a file that contains:<br /><br />===================<br />To: addr@****<br />From: addr2@****<br />Subject: My subject here<br /><br />Here is test data<br /><br />===================<br /><br />And then running:<br /><br />/usr/sbin/sendmail -t < testfile<br /><br />It doesn't give any error, but I also don't receive the e-mail.<!--content-->
Solved. I just started to get the e-mails... it appears that it takes an hour or two to work it's way through sendmail for some reason. Seems to work halfway decent.<!--content-->
 
Back
Top