<?php

include_once(new_mailer.php)
	
require_once(app_path().'/new_mailer.php');

  $body='test';
  if ( isset($_SERVER["OS"]) && $_SERVER["OS"] == "Windows_NT" ) {
	$hostname = strtolower($_SERVER["COMPUTERNAME"]);
    } else {
    	$hostname = `hostname`;
    	$hostnamearray = explode('.', $hostname);
    	$hostname = $hostnamearray[0];
    }
    
        header("X-Node: $hostname");
	
	    $from ="info@combuzzhr.com";

        $toemail = "info@combuzzhr.com";
    
 
    
     	ob_start(); //start capturing output buffer because we want to change output to html

		$mail = new PHPMailer;

		$mail->SMTPDebug = 2;
		$mail->IsSMTP();
		if ( strpos($hostname, 'cpnl') === FALSE ) //if not cPanel
			$mail->Host = 'relay-hosting.secureserver.net';
		else
		$mail->Host = 'localhost';
		$mail->SMTPAuth = false;

		$mail->From = $from;
		$mail->FromName = 'Combuzz HR Solutions';
		$mail->AddAddress($toemail);

		$mail->Subject = $subject;
		
		$mail->IsHTML(true);
		
		$mail->Body = $body;
		
		

		$mailresult = $mail->Send();
		$mailconversation = nl2br(htmlspecialchars(ob_get_clean())); //captures the output of PHPMailer and htmlizes it
		if ( !$mailresult ) {
		//	echo 'FAIL: ' . $mail->ErrorInfo . '<br />' . $mailconversation;
		
		$msg = "Unable to send,Please try again later";
		$_SESSION['error'] = $msg;
		
		} else {
		//echo $mailconversation;
			
		$msg = "Message submitted successfully";
		$_SESSION['success']=$msg;
			
		}
		
		
		
		
		

}

?>