View Full Version : Mail from cron jobs/browser

07-14-2008, 04:14 PM

i'm having trouble with something that i've no idea why its happening.

basically i a cron job setup that emails a warning if something happens, that bit isn't really important.

When i browse to the page it sends me an email. - which gets to me fine at both my business and personal email accounts which i've tested.

I've setup a cron job to run the script for me, and i sends an email to my personal account, however if i change it to my business account it doesn't arrive even in our spam filter.

Its the exact same message being sent from the browser page and the cron job.

So can anyone answer why the browser initiated email is accepted yet the cron job email is rejected?


07-14-2008, 07:33 PM
I'm wondering if this isn't to do with the user executing the cron tab versus the user executing the script. When you browse to it the commands are executed by apache when going through http, but if you are executing it on the command line it is likely a different user (probably you're account). Depending on you're access to cron jobs you may be able to change the user that executes it to apache (or apache named user) to allow it out. In other words, I think the problem is originating on the server that deny's outgoing smtp transfers for you're account. Sounds like it isn't a PHP issue though (depending on the code in use, but I doubt its built to deny you), since you can run it no problem through you're browser.