<?php
set_time_limit(0);
require_once('../includes/phpmailer/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$body = "<div align=center>Please do not reply to this email. It was sent from an automated system and you will not receive a response.</div><br><br>" . $guesthtml;

//$body             = file_get_contents('contents.html');
//$body             = preg_replace('/[\]/i','',$body);

$mail->IsSMTP(); // telling the class to use SMTP
//$mail->Host       = "helpme.interspire.smtp.com"; // SMTP server
$mail->Host       = "port80.smtpcorp.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       = "helpme.interspire.smtp.com"; // sets the SMTP server
$mail->Port       = 80;                    // set the SMTP port for the GMAIL server
//$mail->Port       = 2525;                    // set the SMTP port for the GMAIL server
//$mail->Username   = "mailer@vpsends.com"; // SMTP account username
//$mail->Password   = "mymail21";        // SMTP account password
$mail->Username   = "pilotwebsolutions"; // SMTP account username
$mail->Password   = "TasteSys12";        // SMTP account password

$mail->SetFrom('ordersystem@restaurantonline.biz', 'RestaurantOnline! Order System');

//$mail->AddReplyTo("name@yourdomain.com","First Last");

$mail->Subject    = "Order Update from $webaddress";

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

$mail->MsgHTML($body);

$address = $guestemail;
$mail->AddAddress($address);
//$mail->AddAddress($address, "John Doe");

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

//$mail->Send();	//no error returned...just send and continue to make process faster.
if($mail->Send()){
	echo "Email sent successfully.";
}
//uncomment this section to send with error checking. Must receive response before continuing.
/*if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  //echo "Message sent!";
}*/
?>
