<?php
// $email and $message are the data that is being
// posted to this page from our html contact form

$name 	 = $_POST['userfirstname'] . ' ' . $_POST['userlastname'] ;
$email 	 = $_POST['useremail'];
$message = "<strong>Phone:</strong> " . $_POST['phone'] . "<br/><br/>";
$message = "<strong>Dr. Name:</strong> " . $_POST['userdrname'] . "<br/><br/>";
$message = "<strong>Speciality:</strong> " . $_POST['userspeciality'] . "<br/><br/>";

// When we unzipped PHPMailer, it unzipped to
// public_html/PHPMailer_5.2.0
require("PHPMailer_5.2.0/class.phpmailer.php");

$mail = new PHPMailer();

// set mailer to use SMTP
$mail->IsSMTP();

// As this email.php script lives on the same server as our email server
// we are setting the HOST to localhost
$mail->Host = "mail.protegeglobal.com";  // specify main and backup server

$mail->SMTPAuth = true;     // turn on SMTP authentication

// When sending email using PHPMailer, you need to send from a valid email address
// In this case, we setup a test email account with the following credentials:
// email: send_from_PHPMailer@bradm.inmotiontesting.com
// pass: password
$mail->Username = "mayursupport@protegeglobal.com";  // SMTP username
$mail->Password = "MLMPGmlmpg17543!&^%"; // SMTP password

// $email is the user's email address the specified
// on our contact us page. We set this variable at
// the top of this page with:
$mail->SetFrom($email,$name);

// below we want to set the email address we will be sending our email to.
//$mail->AddAddress("clientrelations@medicallienmgt.com");
$mail->AddAddress("ranafarrukhmobeen@gmail.com");

// set word wrap to 50 characters
$mail->WordWrap = 80;
// set email format to HTML
$mail->IsHTML(true);

$mail->Subject = "New Signup Request!";

// $message is the user's message they typed in
// on our contact us page. We set this variable at
// the top of this page with:

$mail->Body    =  $message;
$mail->AltBody =  $message;
date_default_timezone_set('Asia/Karachi');
if(!$mail->Send())
{
   echo "Your details have not been submitted.";
   //echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

echo "Your details have been submitted successfully we will get back to you on the earliest";
?>