hello i have a shell script that sends out email. here is how it works:
- it reads the html from an url and put it in a file
- loop through all the emails and in the loop it reads from that html file
the problem is:
- the html file becomes empty after a few hundred email for no apparent reason. (i put du /thehtml.html in the email log.)
any one know why? thanks.
source:
/usr/local/bin/lynx --source http://www.site.com/email.php?message=1 > /root/lynx.html
read var < /root/lynx.html
if [ -z "$var" ]; then
echo "" > /dev/null
else
/usr/local/bin/lynx --source http://www.site.com/email.php?list=1 > /root/html_mail.html
number=0
OLDIFS = "$IFS"
export IFS=","
read mails < /root/html_mail.html
for mail in $mails; do
echo "To: $mail " > /root/finished_message.html
cat /root/lynx.html >> /root/finished_message.html
/usr/sbin/sendmail "$mail" < /root/finished_message.html
echo ".*. $number. " - ". $mail .*." >> /bin/scripts/email.log
du /root/lynx.html >> /bin/scripts/email.log
number=$((number+1))
done;
IFS = "$OLDIFS"
lynx --source http://www.site.com/email.php?done_with=1
fi