<?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 = 'server.criap.com';
		$mail->SMTPAuth = TRUE;
		$mail->SMTPSecure = 'tls';
		$mail->Username = 'noreply@criap.com';
		$mail->Password = '$IcriapALL$2020$';
		$mail->Port = 587;
		$mail->CharSet = "UTF-8";


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

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



	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();  
?>