<?php


require_once("$mail_em");
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

//require_once('/usr/share/php/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

//$body             = file_get_contents('contents.html');
//echo $msg;

$body =$msg;
//$subject="YNewThis worked PHPMailer Test Subject via smtp, basic with authentication";
//$to2="vanessa@christianregency.com";
//$firstname="Van";

///$body             = preg_replace('/[\]/i','',$body);

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "smtp.xeran.com"; // SMTP server
//$mail->Host       = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "smtp.xeran.com"; // sets the SMTP server

$mail->Host       = "$servem"; // sets the SMTP server
$mail->Port       = 465;                    // set the SMTP port for the GMAIL server

$mail->Port       = $portem;                    // set the SMTP port for the GMAIL server


//$mail->Username   = "glink@galliumgroup.com"; // SMTP account username
//$mail->Password   = "forget1ca";        // SMTP account password


$mail->Username   = "$userem"; // SMTP account username
$mail->Password   = "$passem";        // SMTP account password

//$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->SetFrom("$userem", "$whoem");
$mail->AddReplyTo("$Reprem","$whoem");

$mail->Subject    = "$subject";

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);

$address = "$to2";
$mail->AddAddress($address, "$firstname");

//$mail->AddAttachment("images/phpmailer.gif");      // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

if(!$mail->Send()) {
//  echo "Mailer Error: " . $mail->ErrorInfo;
$errorEm=1;
} else {
//  echo "Message sent! Yeah";
$errorEm=2;
}


?>
