include 'phpmailer/class.phpmailer.php';

$this->mail = new PHPMailer();
$this->mail->SMTPAuth = true;
$this->mail->Host = 'smtp.gmail.com';
$this->mail->Port = 465;
$this->mail->SMTPSecure = 'tls';
$this->mail->Username = 'user@gmail.com';
$this->mail->Password = 'password';
$this->mail->SetFrom("noreply@yourdomain.com", 'Name');
$this->mail->AddAddress($to,$name);
$this->mail->CharSet = 'UTF-8';
$this->mail->Subject = $subject;
$this->mail->MsgHTML($html_message);

if($this->mail->Send()) {
	return json_encode(array('status'=>1,'message'=>'Success'));
} else {
	return json_encode(array('status'=>0,'message'=>$this->mail->ErrorInfo));
}