I got this one from one of the code archives. Works great for me under win98 without sendmail installed. I just need my smtp server.
//$name : sender's name
//$html : 1 is text/html or 0 is text/plain
//$charser : your charset
function sendmail($name, $from, $to, $subject, $body, $html, $charset ) {
$smtp_server = "smtp.domain.com"; //enter your smtp server here
$smtp_user = "user_name"; //enter your smtp username here
if (!$smtp_sock = fsockopen("$smtp_server", 25)) {
die ("Couldn't open mail connection to $smtp_server! \n");
}
fputs($smtp_sock, "HELO $smtp_server\n");
fputs($smtp_sock, "VRFY $stmp_user\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: your_X-mailer\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 here";
$from = "Your Email";
$to = "Recipient's Email";
$subject = "Fill in the subject";
$body = "Type the body of email here";
sendmail($name, $from, $to, $subject, $body, 1, "euc-kr");
?>