Crontab not running "nail" in script

the script is in Perl... this is one part of it:

$command = "echo \"$text\" | /usr/bin/nail -s \"My $text1\" $ccstr$addstr";
system("$command") if length($bodytext)>1;

crontab runs the script and sends me notifications but i cant receive any mail that i wanted!

I'm using the complete path for the script in crontab.

:confused:

Are you running the script as the same user that the crontab is for ?

potentially you have environment issues....

you may want to explicitly su to the user (/usr/bin/su USER -c '....') within the cron entry.

HTH