Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Mail from cron jobs/browser

    Hello,

    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?

    Thanks

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •