chleng
02-06-2006, 10:04 AM
Hi,
I'm now running Windows XP
my script
echo "<html><body>";
$recipient = "ABC mail<"."abc@abc.com".">";
$subject = "Testing the mail function";
$message = "Hello!\n\nThis is the body of the message.\n\n";
//$extra = "From: kris@phpworld.com\r\nReply-To: karn@nucleus.com\r\n";
$header = "From: Kris <kris@phpworld.com>";
$status =mail ($recipient, $subject, $message, $header);
if ($status === false)
{
echo "Mail is not accepted for delivery!";
}
echo "Sending mail...";
echo "</body></html>";
Error that display
Warning: mail() [function.mail]: SMTP server response: 501 <ABC Mail<abc@abc.com>>: "@" or "." expected after "ABC" in D:\wwwroot\osmslife\osmslife\Store\mail07.php on line 11
Mail is not accepted for delivery!Sending mail...
but when I change $recipient
echo "<html><body>";
$recipient = "abc@abc.com";
$subject = "Testing the mail function";
$message = "Hello!\n\nThis is the body of the message.\n\n";
//$extra = "From: kris@phpworld.com\r\nReply-To: karn@nucleus.com\r\n";
$header = "From: Kris <kris@phpworld.com>";
$status =mail ($recipient, $subject, $message, $header);
if ($status === false)
{
echo "Mail is not accepted for delivery!";
}
echo "Sending mail...";
echo "</body></html>";
it works. why is this so? any solution? program error or setting error? thanks!
Note: I've changed email to prevent spam robots from detecting emails. Please change it accordingly
I'm now running Windows XP
my script
echo "<html><body>";
$recipient = "ABC mail<"."abc@abc.com".">";
$subject = "Testing the mail function";
$message = "Hello!\n\nThis is the body of the message.\n\n";
//$extra = "From: kris@phpworld.com\r\nReply-To: karn@nucleus.com\r\n";
$header = "From: Kris <kris@phpworld.com>";
$status =mail ($recipient, $subject, $message, $header);
if ($status === false)
{
echo "Mail is not accepted for delivery!";
}
echo "Sending mail...";
echo "</body></html>";
Error that display
Warning: mail() [function.mail]: SMTP server response: 501 <ABC Mail<abc@abc.com>>: "@" or "." expected after "ABC" in D:\wwwroot\osmslife\osmslife\Store\mail07.php on line 11
Mail is not accepted for delivery!Sending mail...
but when I change $recipient
echo "<html><body>";
$recipient = "abc@abc.com";
$subject = "Testing the mail function";
$message = "Hello!\n\nThis is the body of the message.\n\n";
//$extra = "From: kris@phpworld.com\r\nReply-To: karn@nucleus.com\r\n";
$header = "From: Kris <kris@phpworld.com>";
$status =mail ($recipient, $subject, $message, $header);
if ($status === false)
{
echo "Mail is not accepted for delivery!";
}
echo "Sending mail...";
echo "</body></html>";
it works. why is this so? any solution? program error or setting error? thanks!
Note: I've changed email to prevent spam robots from detecting emails. Please change it accordingly