uhm ... so strange, last week I check a simplemail.php , it say I should check out parameter in php.ini includes SMPT and SMPT_port, they get right value. Today, I check the SMPT connection by using Run -> Typing telnet localhost 25 -> It say failed connection ; after that I try to use Outlook Express to send mail and it runs well and now, back to simplemail.php it says the new error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in ... line ..
<?php$To = "b@yahoo.com";$Text = "This is a test.";$Html = "<H1>This is a test.</H1>";$Subject = "PHP Mail Test";$message = "";$headers = "From: a@mail.com\n";$headers .= "X-Mailer: PHP4\n";$headers .= "X-Priority: 3\n";$headers .= "MIME-Version: 1.0\n";$headers .= "Content-Type: multipart/alternative;boundary=\"==MIME_BOUNDRY_alt_main_message\"\n\n";$headers .= "This part of the E-mail should never be seen. If you arereading this, consider upgrading your e-mail client to a MIME-compatibleclient.";$message .= "--==MIME_BOUNDRY_alt_main_message\n";$message .= "Content-Type: text/plain; charset=ISO-8859-1\n";$message .= "Content-Transfer-Encoding: 7bit\n\n";$message .= $Text . "\n\n";$message .= "--==MIME_BOUNDRY_alt_main_message\n";$message .= "Content-Type: text/html; charset=ISO-8859-1\n";$message .= "Content-Transfer-Encoding: 7bit\n\n";$message .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0Transitional//EN\">\n";$message .= "<HTML><BODY>\n";$message .= $Html . "\n";$message .= "</BODY></HTML>\n\n";$message .= "--==MIME_BOUNDRY_alt_main_message--\n";mail($To, $Subject, $message, $headers); ?>// get this code from PHP Bugs