
Originally Posted by
suedree
Hai... I'm new in this forum.. I need help in php email. I've got sick searching around the net about this but yet I can't find any solution. So if there anybody out there would help me, I will really appreciate.
....
when I use this one, no error appear, but the email itself does not sent.
....
an error appear
Warning: Server Error in c:\apache\htdocs\e-score\test_email.php on line 13
and line 13 : mail($to, $subject, $message,$header);
anybody have any idea on how to fix this one????
Hi, Suedree!
You have named "$headers" as "$header" in both cases when you send the mail:
Change to this instead, then you can try again;
PHP Code:
<?php
$to = "serene@gmail.com";
$subject = 'the subject';
$message = 'hello';
$headers[] = "From: webmaster@localhost.com";
$headers[] = "Reply-To: webmaster@localhost.com";
$headers[] = "X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, implode("\r\n", $headers) );
?>
Is this the right soloution?
Best regards,
mbrodin
Bookmarks