i'm using sendmail for a mailing list and it's working great, but my headers are not working out.
for instance - they show up from an 'unkown sender' w/ no subject, filtered as spam and my headers show up in the actual email.
i'm using gmail to test - here's the code:
<?
function SendEmail($to,$subject,$message)
{
$fd = popen("/usr/sbin/sendmail -t", "w");
fputs($fd, "Content-type: text/html; charset=iso-8859-1\r\n");
fputs($fd, "Reply-To: MyName <email@domain.com>\r\n");
fputs($fd, "Return-Path: MyName <email@domain.com>\r\n");
fputs($fd, "To: $to\r\n");
fputs($fd, "From: MyName <email@domain.com>\r\n");
fputs($fd, "Subject: $subject\r\n");
fputs($fd, "X-Mailer: PHP4\r\n\r\n");
fputs($fd, $message);
pclose($fd);
}
while($row = mysql_fetch_array($rsList))
{
$email = $row['email'];
$message = "Hello $email";
SendEmail($email, $subject, $message);
}
?>