Código PHP:
function XSendMail($to,$nombrefrom,$from,$subject,$message,$html="")
{
//$to="[email protected]";
//echo "to:".$to."<br>"."nom:".$nombrefrom."<br>"."fro:".$from."<br>"."subj:".$subject."<br>"."mess:".$message."<br>";
$headers.= "MIME-Version: 1.0\r\n";
if($html=="1")
{
$headers.= "Content-type: text/html; charset='iso-8859-1'\r\n";
}
$headers.= "From: ".$nombrefrom."<".$from.">\r\n";
$headers.= "Reply-To: \r\n";
$headers.= "X-Priority: 1\r\n";
$headers.= "X-MSMail-Priority: High\r\n";
$headers .= "Return-Path: <[email protected]>\r\n";
$headers .= "X-Mailer: ar-server";
if(!($to and $subject and $message and $headers))
{
//echo "no";
$msg = "El Mail No se pudo enviar";
return -1;
}
else{
//echo "si";
//echo $to."-".$subject."-".$message."-".$headers; die();
mail($to, $subject, $message, $headers);
$msg = "Enviando Mail a $to\n";
return 1;
}
}