PHP not sending email on W2K Box with IIS STMP installed
Posted: Fri Feb 27, 2009 8:11 pm
Hello Folk,
I looked around and really didn't find an answer for this specific problem. I'm a.NET guy that is trying to help out a fellow PHP guy rebuild a web app from vb.net to PHP. Send mail in .NET works correctly using the virtual SMTP server in IIS 6. But when trying to send a mail using PHP 5.2.3 there seems to be nothing happening.
I've executed the php_info() method which shows the follow for the mail specific values:
mail.force_extra_parameters no value no value
sendmail_from no value no value
sendmail_path no value no value (I understand this one is not used in win enviorments)
SMTP localhost localhost
smtp_port 25 25
Internal Sendmail Support for Windows enabled
I looked in the php.ini and noticed that sendmail_from was set to a generic value even though php_info() shows it as not set (which I read is a common problem)
I did some other searching on the web and I found this:
if (!mail($To, $Subject, $Msg, "From:\t$From\r\n"."Reply-To:\t$From\r\n"))
{
echo "mail() did not succeed";
}
else
{
echo "mail() executed correctly.";
}
Which returns a "not succeed" message. Any help would be appreciated. Keep in mind I'm not a PHP guy so a bit extra explanation would be appreciated.
Thanx in advance,
Peter
I looked around and really didn't find an answer for this specific problem. I'm a.NET guy that is trying to help out a fellow PHP guy rebuild a web app from vb.net to PHP. Send mail in .NET works correctly using the virtual SMTP server in IIS 6. But when trying to send a mail using PHP 5.2.3 there seems to be nothing happening.
I've executed the php_info() method which shows the follow for the mail specific values:
mail.force_extra_parameters no value no value
sendmail_from no value no value
sendmail_path no value no value (I understand this one is not used in win enviorments)
SMTP localhost localhost
smtp_port 25 25
Internal Sendmail Support for Windows enabled
I looked in the php.ini and noticed that sendmail_from was set to a generic value even though php_info() shows it as not set (which I read is a common problem)
I did some other searching on the web and I found this:
if (!mail($To, $Subject, $Msg, "From:\t$From\r\n"."Reply-To:\t$From\r\n"))
{
echo "mail() did not succeed";
}
else
{
echo "mail() executed correctly.";
}
Which returns a "not succeed" message. Any help would be appreciated. Keep in mind I'm not a PHP guy so a bit extra explanation would be appreciated.
Thanx in advance,
Peter