PHP doesn't seem to be reading/paying attention to the smtp settings in php.ini. The settings in php.ini are as follows:
[mail function]
; For Win32 only.
SMTP = smtp.idcomm.com
smtp_port = 25
sendmail_from = ecommerce@idcomm.com
But phpinfo() shows this (sorry it's not as pretty as the orginal):
SMTP. . . . . . . . . . . .localhost . . . localhost
smtp_port . . . . . . .25 . . . . . . . . .25
sendmail_from . . . no value . . . .no value
When I try to use the mail() function, I get:
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Web Sites\Business\sshtest\test.php on line 171
Unable to send mail.
Even though I'm using the following code and trying to send a From header:
$to = "webdev@idcomm.com";
$subject = "Test mail from ecommerce website";
$msg = "This is a test from sshtest.com on ecommerce. Let's see if it gets through.";
$from = "From: ecommerce@idcomm.com";
if (mail($to, $subject, $msg, $from)) {
echo "Mail sent successfully.";
} else {
echo "Unable to send mail.";
}
Any ideas would be appreciated....
- Scott