I need to setup a shell script with cron jobs that will e-mail a list of users from a file (I would perfer a mysql databse but might be a bit complicated!)
This is the current script that is not working - it just a test
#!/bin/sh
if `test -e mail/outmail`
then
echo -e "From: enquiries@chickencookery.c
o.uk\r" >makemail
echo -e "To:
emailaddress\r"> makemail
mail/outmail >> makemail
/usr/sbin/sendmail -t <makemail
cat makemail
rm -f makemail
fi
echo -e "/n ran script /n";
The script test to make sure that there is a file with a subject called outmail. It will then email it to the address supplied (This will be a a file) and send another e-mail me saying the script has run.
Please Help I am new to writting shell scripts
Michael
Start Free Trial