Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- sendmail from localhost is driving me crazy!
February 3, 2014, 9:03 am
rate this thread
My sendmail config is
My Php.ini file now contains the following
sendmail_path = "c:\wamp\sendmail\sendmail.exe -t -i"
And yet I cannot send a mail. I had this working before I moved my PC from XP to Windows 8 so I really don't know what is wrong.I have tried every combination of port and SSL, turned off firewalls. Nothing.
I enabled “ssl_module” module in Apache server
enabled “php_openssl” and “php_sockets” extensions for PHP compiler.
But nothing is coming through. My PHP code is pretty simple
$to = 'firstname.lastname@example.org';
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: email@example.com' . "\r\n" .
'Reply-To: firstname.lastname@example.org' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers))
echo "Email sent. ";
echo "Email sending failed. ";
thanks is advance
Re: sendmail from localhost is driving me crazy!
This format is specific to the mail program and they all offer sendmail
compatibility so that name alone is not much help.
Separate the mail sending from PHP. Can you send a message using
sendmail on its own? If sending fails, there is likely to be some sort
of log file which will tell you more, but where that will be is
dependent on which mail program you are using.
These are not involved. PHP just runs the sendmail command.
What do you get here?