<?php 


// extract($_POST);

// $emails = explode(",",$emailTo);
// print_r($emails);

// die();

require_once 'phpmailer/PHPMailerAutoload.php';

if ( isset($_POST['sendEmail'])) {
	extract($_POST);
	$server ="gmail.com";
	
$mail = new PHPMailer;
$mail->isSMTP();
$mail->isMail(true);
$mail->Host = 'smtp.'.$server;
$mail->Port = 465;
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true;
$mail->SMTPDebug = 1;


    $mail->Username = "";
    $mail->Password = "";
    

 $mail->setFrom("kamih14@gmail.com", "kamih14@gmail.com");

$mail->addAddress("kamransiyal9@gmail.com","user");

if ($mail->addReplyTo("kamih14@gmail.com")) {
    $mail->Subject = "working".' is Contact us';
    //$mail->WordWrap = 50000;               // set word wrap
    $mail->Priority = 1; 
    $mail->IsHTML(true); 
    $mail->Body    = "working from email";
    $mail->AltBody = "";
        if (!$mail->send()) {
            echo $msg = $mail->ErrorInfo;
        } else {
          echo   $msg = 'Message sent! Thanks for contacting us.';
        }
    } else {
        echo $msg = 'Invalid email address, message ignored.';
    }
}

?>