Sendmail not working from local PHP when headers not specified

Posted by Dan on Server Fault See other posts from Server Fault or by Dan
Published on 2010-04-10T11:20:31Z Indexed on 2010/04/10 11:23 UTC
Read the original article Hit count: 629

Filed under:
|
|
|

Hi. I'm having trouble getting my local XAMPP server to send emails via my remote SMTP server.

In PHP, if I put:

$headers  = "From: [email protected]\r\n";
mail('[email protected]', 'test', '', $headers);

Then this works. However, if I don't specify the header, ie.:

mail('[email protected]', 'test', '');

Then this fails. The sendmail.log file says:

smtpstatus=554 smtpmsg='554 Message refused.' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

I've tried changing my sendmail command in my php.ini to:

sendmail_path = "C:/xampp/sendmail/sendmail.exe -t -f [email protected]"

but this doesn't work either.

Thanks for any help with this, Dan.

ps. this is on windows.

© Server Fault or respective owner

Related posts about php

Related posts about sendmail