<?php


require 'phpmailer-send/PHPMailer.php';
require 'phpmailer-send/SMTP.php';


error_reporting(-1);
ini_set('display_errors', 'On');
set_error_handler("var_dump");


		$mail = new PHPMailer;

		$mail->IsSMTP();
		/*$mail->Host = 'd2wvm305.dot2web.com';*/
		$mail->Host = 'ml.criap.com';
		$mail->SMTPAuth = TRUE;
		$mail->SMTPSecure = 'tls';
		/*$mail->SMTPSecure = 'ssl';*/
		/*$mail->SMTPSecure = '';*/
		$mail->Username = 'noreply@criap.com';
		$mail->Password = '$IcriapALL$2020$';
		$mail->Port = 587;
		/*$mail->Port = 465;*/
		/*$mail->Port = 25;*/
		$mail->CharSet = "UTF-8";


		$mail->setFrom('no-reply@criap.com', 'Instituto CRIAP');
		$mail->addAddress('josesa@criap.com');
		$mail->addReplyTo('no-reply@criap.com', 'Instituto CRIAP');
		$mail->isHTML(true);

		$mail->Subject = "TESTE EMAIL";
		$mail->Body = "Teste Email Body";



	if(!$mail->send())
	{
		echo 'Message could not be sent.';
		echo 'Mailer Error: ' . $mail->ErrorInfo;
	}
	else
	{
		echo 'Message has been sent';
	}

/*
$headers = array("From: Instituto CRIAP <no-reply@criap.com>",
			"Reply-To: josesa@criap.com",
			"X-Mailer: PHP/" . PHP_VERSION
		);
$headers = implode("\r\n", $headers);
$result = mail('josesa@criap.com', 'test certificado email', 'serve o presente email para test a função mail php', $headers);

echo "<br>result=" . $result;
*/
/*echo "<br>PHP_VERSION=" . PHP_VERSION;*/

//print phpinfo();  
?>