Warning: mail() [function.mail]: SMTP server response: 551 User not local; please try <forward-path> in C:\xampp\htdocs\testmail.php on line 11
Hello, I am wondering is anyone has a clue what this source of this problem is?
I am trying to get php mail() to work with xampp that I just installed. I have used the form to send email via mercurymail and it works perfectly but any attempt to try to use php mail directly in a script produces this error message and of course fails to send the message.
My test script is a no brainer actually:
$mailtos = "webmaster@mydomain.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "postmaster@mydomain.com";
$header = "From: $from";
if (mail($mailtos, $subject, $message, $header)) {
echo "<i>mail-sendok</i>";
} else {
echo "<i>mail-sendnotok</i>";
}
I have used every reference I can think of to point the smtp in php.ini to my ISP server and nothing works? It did work correctly when I had Apache2Triad installed but xampp seems to have a problem with it.
Here is the php.ini piece, fyi:
[mail function]
; For Win32 only.
SMTP = mail.mydomain.com
smtp_port = 25
; For Win32 only.
sendmail_from =
webmaster@mydomain.com
Any light at all will be greatly appreciated, kindest regards, mikesz