Could not instantiate mail function.

Help
2011-10-17
2012-09-18
  • Mike Knichel

    Mike Knichel - 2011-10-17

    I have a script that will run fine when run manually but when i try to run via
    cron, I get this in my inbox...

    sh: sendmail: not found

    Could not instantiate mail function.

    Message could not be sent.

    Mailer Error: Could not instantiate mail
    function.

    I have made sure the from address is valid as suggested on other sites.

     
  • Ooypunk

    Ooypunk - 2011-10-17

    It is what it says it is: sendmail wasn't found. Remember that, when run from
    cron, the working location is different, so check the paths, especially that
    to sendmail (be sure to use the full path).

     
  • Mike Knichel

    Mike Knichel - 2011-10-17

    Where am I looking for the path to sendmail? In the class.phpmailer... ?

     
  • Mike Knichel

    Mike Knichel - 2011-10-17

    Not sure if this makes a difference... I am running the cron as same user when
    I run manually. I also have postfix installed in addition to sendmail it
    seems.

     
  • Ooypunk

    Ooypunk - 2011-10-17

    Check this page: http://phpmailer.worxware.com/index.php?pg=properties , about half of the page:

    $Sendmail public /usr/sbin/sendmail Sets the path of the sendmail program.

    Maybe your sendmail isn't at /usr/sbin/sendmail?

     
  • Mike Knichel

    Mike Knichel - 2011-10-17

    my sendmail is /usr/sbin/sendmail

    However, it was a PATH issue as it happens. Adding the path to sendmail to the
    cron file execution of the script has corrected this problem.

    Thanks for your input.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks