help with crontab

i have a ksh script that creates messages in a temp directory and then sends them out using the sendmail command and i'm trying to set it up to run every night with crontab.
So the basic gist of the script is
#create temp dir and messages
...
#loop through each message and send using sendmail
ls $dateFolder/Group/* | \
while read tempMsg
do
cat $tempMsg | /usr/lib/sendmail -t
done

When I run the script from the command line in my home directory it works perfectly, but then when I edit my crontab file with something like:
48 23 * * *
/home/users/campbelr/ddts_reminder.ksh /home/users/campbelr/ddts_reminder_config.txt

the temp directory and files are created, but the sendmail command does not execute. I'm an unix shell scripting newbie, so i don't understand how this could happen. is it an environment difference? any ideas?

Try replaceing the sendmail command with /usr/bin/mailx (toaddress)
you can add a subject if you wish ie
/usr/bin/mailx -s "your subject" me@myhost.com

also you could use ls -1 to force a single line output for your while loop.

update your script to use the full path to the sendmail binary.

i need to use sendmail and not mailx because all of the header stuff: to, from, subject, etc. are stored in the message, so using the sendmail -t command simplifies things alot.

and

I am using the full path to the sendmail binary
/usr/lib/sendmail