<?php



require 'PHPMailer/PHPMailerAutoload.php';





define('EMAIL_SMTP_HOST', 'mail.vdeskworks.gq');

define('EMAIL_SMTP_PORT', '25');

define('EMAIL_SMTP_CRYPTO', 'tls');

define('EMAIL_SMTP_USER', 'msp@vdeskworks.gq');

define('EMAIL_SMTP_PASSWORD', 'Jdfu(7fu5W4S1');

define('EMAIL_SMTP_TIMEOUT', '60');

$mail = new PHPMailer;

		

		$mail->isSMTP();            

		                          

		$mail->Host = EMAIL_SMTP_HOST;

		$mail->SMTPAuth = TRUE;   

		$mail->Username = EMAIL_SMTP_USER;                 

		$mail->Password = EMAIL_SMTP_PASSWORD; 

		$mail->Port = EMAIL_SMTP_PORT; 

		$mail->From = EMAIL_SMTP_USER;

		/*$mail->SMTPSecure = 'tls';*/

		$mail->FromName = 'IFA';

		$mail->Timeout = 300;

		$mail->AllowLegacyTLSClients = FALSE;

			$mail->SMTPOptions = array(

	    'ssl' => array(

	        'verify_peer' => false,

	        'verify_peer_name' => false,

	        'allow_self_signed' => true

    )

);



		

		$mail->addAddress('skaur@cogniter.com', 'steve');

		$mail->isHTML(TRUE);

		$mail->SMTPDebug  = 3;

		$mail->LE = "\r\n";

		$sub = '=?UTF-8?B?'.base64_encode('Content email').'?=';

		$mail->Subject = $sub;

		

		$body = 'Username and password genrate';







				

		$mail->Body = $body;

		

		$mail->AltBody = $body;



		

		if(!$mail->send()) {

			$result =  array(

						'state'		=> FALSE,

						'message'	=> "Unable to send email. Please check the error ".$mail->ErrorInfo

					);

		} 

		else 

		{

		    $result = array(

						'state'		=> TRUE,

						'message'	=> "Email Sent successfully."

					);

		}



		print_r($result);



















die;









