<?php  

  session_start();
  set_time_limit(0);
  ini_set('max_execution_time', 0);
  // error_reporting(0);
   include("../db.php");
   include("../all_query.php");
		
  
  
    $templateQ = mysqli_query($conn,"select *from `website_pages` where title='Mail_Templete_1' order by id desc   limit 1 ");
	$templateData = mysqli_fetch_assoc($templateQ);
	$content = $templateData['content'];
     
	  
	  
	 
	 $recipients = array(
		array(
			'email' => 'softdream.a@gmail.com',
			'name' => 'Arbaz Shaikh'
		),
		array(
			'email' => 'Ishtiyaks@gmail.com',
			'name' => 'Ishtiyak'
		)
	);
	try {
		  require_once 'SendCleanMTA_PHP-master/SendClean.php';
		 $SendClean= new SendClean('25833713', 'pFdBjYPk2cs0YXlK7y02', 'us1-mta1.sendclean.net');
		$smtp_user_name = "smtp78596013";
		foreach ($recipients as $recipient) {
			$message = array();
			$message["html"] = $content;
			$message["subject"] = "Test Email";
			$message["from_email"] = "info@finmanservices.in";
			$message["to"] = array(
				array("email" => $recipient['email'], "name" => $recipient['name'], "type" => "to")
			);
			$message["headers"] = array("Reply-To" => "info@finmanservices.in", "X-Unique-Id" => "Id");
			$result = $SendClean->messages->sendMail($smtp_user_name, $message);
			print_r($result);
			/*
			  Array
			  (
			  [status] => "success"
			  [message] => "message have been Queued ... "
			  )
			 */
		}
	} catch (SendClean_Error $e) {
		// SendCleanerrors are thrown as exceptions
		echo "A SendCleanerror occurred: " . get_class($e) . " - " . $e->getMessage();
	}
		  
		  
		  
		  
	  
	  
	  
	  
	  
	  
	  
	  
	  

 
  ?>