Re: mail function problem
| From: | web2 | Date: | Wed, 04 Jul 2007 09:35:11 +0000 |
| Subject: | Re: mail function problem | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258229@lists.php.net to get a copy of this message | ||
Chris a écrit :
I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. If you have any solutions...Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail.Try this: <? $email = "test@zz.fr"; $headers = "From: ".$email."\r\n"; $headers .= "X-Mailer: PHP/".phpversion()."\r\n"; if(mail("test2@zz.fr","essai","test",$headers)) { echo "OK: ".ini_get('sendmail_path'); } else { echo "NOK: ".ini_get('sendmail_path'); } ?> NoteSame result : "NOK /usr/lib/sendmail -t -i" I think the problem is not in the test script.