chigley Posted March 9, 2008 Share Posted March 9, 2008 Hey all. I've been having some problems when using the mail() in a PHP script being executed with a Cron job. When I type the filename into my browser, I receive the email. Yet for some reason the email is not sent when the file is executed by the Cron demon. Any suggestions? Cheers Link to comment https://forums.phpfreaks.com/topic/95237-solved-mail-inside-a-cron-job/ Share on other sites More sharing options...
trq Posted March 9, 2008 Share Posted March 9, 2008 Is the actual script being executed? Can we see your crontab entry? Link to comment https://forums.phpfreaks.com/topic/95237-solved-mail-inside-a-cron-job/#findComment-487842 Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 php /path/to/file.php I know the script is definitely being executed because the database is being updated. Cheers Link to comment https://forums.phpfreaks.com/topic/95237-solved-mail-inside-a-cron-job/#findComment-487858 Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 OK well I decided to try doing it the way it's worked in the past on another project (I didn't realise I was doing it differently to last time): /usr/local/bin/php /path/to/file.php And now I get errors along these lines: Warning: include(../includes/mysql.php): failed to open stream: No such file or directory in /home/zignet/public_html/sitefunctions/update.php on line 3 Warning: include(): Failed opening '../includes/mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zignet/public_html/sitefunctions/update.php on line 3 Advice appreciated Link to comment https://forums.phpfreaks.com/topic/95237-solved-mail-inside-a-cron-job/#findComment-487860 Share on other sites More sharing options...
chigley Posted March 9, 2008 Author Share Posted March 9, 2008 Right well I've fixed the include errors, but the email code still isn't working.. EDIT: Whoop managed to get it to work Where's the "Topic Solved" button gone? Link to comment https://forums.phpfreaks.com/topic/95237-solved-mail-inside-a-cron-job/#findComment-487870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.