<?php
//
require 'PHPMailerAutoload.php';

		
			$name = "faisal";
			$email = "ayaanply123@gmail.com";
			$promoCode = "132131http://apps4real.com/epiweb/includes/Email/emailtest.php";
			
			sendEmail($email, $name, $promoCode);
		
		 
	function sendEmail($email, $name, $promoCode){

		$mail = new PHPMailer;

		$htmlversion="<p style='color:red;'>Hi ".$name.", <br><br> This is your promo code HTML : ".$promoCode.". </p>";
		$textVersion="Hi ".$name.",.\r\n This is your promo code:  ".$promoCode."text Version";
		$mail->isSMTP();                                     		 // Set mailer to use SMTP
		$mail->Host = 'apps4real.com';  								// Specify main and backup SMTP servers
		$mail->SMTPAuth = true;                                // Enable SMTP authentication
		$mail->Username = 'root';         			  // SMTP username
		$mail->Password = 'Fir2017Raj';                      // SMTP password
		$mail->Port = 26;                                   // TCP port to connect to
		$mail->setFrom('apps4real@vps.apps4real.com', 'Test Email');
		$mail->addAddress($email);               // Name is optional
//		$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
//		$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
		$mail->isHTML(true);                                  // Set email format to HTML
		$mail->Subject = 'Test Email Subject';
		$mail->Body    = $htmlversion;
		$mail->AltBody = $textVersion;

	if(!$mail->send()) {
			echo 'Message could not be sent.';
			echo 'Mailer Error: ' . $mail->ErrorInfo;
	} else {
		echo 'Message has been sent to User name : '.$name.' Email:  '.$email.'<br><br>';
	}
}
?>