The mail function under windows is buggy.
Instead of using localhost as the smtp, use the something like smtp.yourisp.com. But even that does not guarantee success.
Unless you have a mail server running on localhost, always use the smtp server address.
Also, instead of me@localhost.com, use me@yourisp.com. Some isp's filter out any outgoing mail that does not carrry the isp's domain name.
Make sure you configure Outlook, and then use the same config info inside your php.ini.
If mail() still does not work, try sockets. Below is a sample code...
function sendmail($name, $from, $to, $subject, $body, $html, $charset ) {
$smtp_server = "smtp.yourisp.com"; //enter your smtp server here
if (!$smtp_sock = fsockopen("$smtp_server", 25)) {
die ("Couldn't open mail connection to server! \n"); }
fputs($smtp_sock, "HELO $smtp_server\n");
fputs($smtp_sock, "VRFY $smtp_server\n");
fputs($smtp_sock, "MAIL FROM:<$from>\n");
fputs($smtp_sock, "RCPT TO:<$to>\n");
fputs($smtp_sock, "DATA\n");
fputs($smtp_sock, "From: $name($from)\n");
fputs($smtp_sock, "X-Mailer: emailer1.0\n");
if ($html)
fputs($smtp_sock, "Content-Type: text/html;");
else
fputs($smtp_sock, "Content-Type: text/plain;");
fputs($smtp_sock, "charset=$charser\n");
fputs($smtp_sock, "MIME-Version: 1.0\n");
fputs($smtp_sock, "Subject: $subject\n");
fputs($smtp_sock, "To: $to\n");
fputs($smtp_sock, "$body");
fputs($smtp_sock, "\n.\nQUIT\n");
fclose($smtp_sock);
}
$name = "Your Name";
$from = "YourEmail@yourisp.com";
$to = "recipient@domain.com";
$subject = "Enter a subject here!";
$body = "Include your email body here";
sendmail($name, $from, $to, $subject, $body, 1, "euc-kr");
Goodluck.
Richie.