<?php

$mail_subject=$_POST['mail_subject'];
$email_list=$_POST['email_list'];
$msg=$_POST['mail_body'];
$from="tarun@foub.com";
$mail_body=<<<END
my msg:$msg
END;

$headers=<<<EOSTR
From:<$from>

EOSTR;

$process=explode(",",$email_list);
reset($process);
foreach ($process as $to) {
ini_set("SMTP","127.0.0.1");
ini_set("smtp_port","25");
$sent=mail($to,$mail_subject,$mail_body,$from);
}
if ($sent) {
echo "<b> Email has been successfully sent </b><br><br>";
echo "<b> Message : </b><br>$mail_body";
} else {
echo "Email could not be sent, there may be errors in the e-mail address";
}

?>

