<?php

	require 'class/class.phpmailer.php';
	$output = '';
	
		$mail = new PHPMailer;
		//$mail->IsSMTP();								//Sets Mailer to send message using SMTP
		$mail->Host = 'smtp@gmail.com';		//Sets the SMTP hosts of your Email hosting, this for Godaddy
		$mail->Port = '80';								//Sets the default SMTP server port
		$mail->SMTPAuth = true;							//Sets SMTP authentication. Utilizes the Username and Password variables
		$mail->Username = 'username@gmail.com';					//Sets SMTP username
		$mail->Password = '123456';					//Sets SMTP password
		$mail->SMTPSecure = 'tls';							//Sets connection prefix. Options are "", "ssl" or "tls"
		$mail->From = 'nadeem@gmail.com';			//Sets the From email address for the message
		$mail->FromName = 'Nadeem Haidar';					//Sets the From name of the message
		$mail->AddAddress($row["email"], $row["name"]);	//Adds a "To" address
		$mail->WordWrap = 50;							//Sets word wrapping on the body of the message to a given number of characters
		$mail->IsHTML(true);							//Sets message type to HTML
		$mail->Subject = ($cont['subject']); //Sets the Subject of the message
		//An HTML or plain text message body
		$mail->Body = "
		<p>Sed at odio sapien. Vivamus efficitur, nibh sit amet consequat suscipit, ante quam eleifend felis, mattis dignissim lectus ipsum eget lectus. Nullam aliquam tellus vitae nisi lobortis, in hendrerit metus facilisis. Donec iaculis viverra purus a efficitur. Maecenas dignissim finibus ultricies. Curabitur ultricies tempor mi ut malesuada. Morbi placerat neque blandit, volutpat felis et, tincidunt nisl.</p>
		";

		$mail->AltBody = '';

		$result = $mail->Send();	//Send an Email. Return true on success or false on error

		if($result["code"] == '400')
		{
			$output .= html_entity_decode($result['full_error']);
		}
		if($output == '')
		{
		echo 'ok';
		}
		else
		{
		echo $output;
		}
		?>