<?php
// define('EMAIL_SMTP_HOST', 'mail.cogniter.com');
// define('EMAIL_SMTP_PORT', '25');
// define('EMAIL_SMTP_CRYPTO', 'tls');
// define('EMAIL_SMTP_USER', 'smtp_auth@cogniter.com');
// define('EMAIL_SMTP_PASSWORD', 'Dj#Lk!M^78*R');
// define('EMAIL_SMTP_TIMEOUT', '60');


// define('EMAIL_SMTP_HOST', 'smtp.gmail.com');
// define('EMAIL_SMTP_PORT', '465');
// define('EMAIL_SMTP_CRYPTO', 'ssl');
// define('EMAIL_SMTP_USER', 'devlabsmtp@gmail.com');
// define('EMAIL_SMTP_PASSWORD', 'vpehxedwiauvnejg');
// define('EMAIL_SMTP_TIMEOUT', '60');


// define('EMAIL_SMTP_HOST', 'hgws7.win.hostgator.com');
// define('EMAIL_SMTP_PORT', '587');
// define('EMAIL_SMTP_CRYPTO', 'tls');
// define('EMAIL_SMTP_USER', 'smtp@segnant.com');
// define('EMAIL_SMTP_PASSWORD', '4A?zyr153RR%');
// define('EMAIL_SMTP_TIMEOUT', '60');

define('EMAIL_SMTP_HOST', 'p1402.use1.mysecurecloudhost.com');
define('EMAIL_SMTP_PORT', '25');
define('EMAIL_SMTP_CRYPTO', 'tls');
define('EMAIL_SMTP_USER', 'mkt@segnant.cc');
define('EMAIL_SMTP_PASSWORD', 'h47^8n9Sx');
// define('EMAIL_SMTP_USER', 'marketing@segnant.cc');
// define('EMAIL_SMTP_PASSWORD', '1g2X16ey$');
// define('EMAIL_SMTP_USER', 'Consultation@segnant.cc');
// define('EMAIL_SMTP_PASSWORD', 'u96bi6K&4');

define('EMAIL_SMTP_TIMEOUT', '60');




//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/vendor/autoload.php';

$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 = EMAIL_SMTP_CRYPTO;
		$mail->FromName = 'IFA';
		$mail->Timeout = 300;
		$mail->AllowLegacyTLSClients = TRUE;

		
		$mail->addAddress('skaur@cogniter.com', 'Phil');
		$mail->isHTML(TRUE);
		$mail->SMTPDebug  = 2;
		$sub = 'https mkt username genrated';
		$mail->Subject = $sub;
		
		$body = 'https 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);

		//phpinfo();











