Current File : /home/inlingua/public_html/templates/inlingua/javascript/ajax1.php
<?php
require("../../../icentex/class.phpmailer.php");
//include("../../../timesheet/dbConnection.php");
// Include the database connection details
require('../../../icentex/dbConnection.php');

// Include common functions
require('../../../icentex/commonFunc.php');

// Include common functions
require('../../../icentex/globalVars.php');

// Include the table handler class
require('../../../icentex/dbHandler.class.php');

// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
//print_r($_REQUEST);

$query="insert into ingl_callback (cad_name,email,contact,createDate) values ('".$_REQUEST[sender]."','".$_REQUEST[email]."','".$_REQUEST[phone]."','".date("Y-m-d H:i:s")."')";
$result=mysql_query($query) or die(mysql_error());

$query1="insert into  jos_corporate_contact (fname,phn,emai,last_contact_date,lead_source,contact_person,handle_by,createDate) values ('".$_REQUEST[sender]."','".$_REQUEST[phone]."','".$_REQUEST[email]."','".date("Y-m-d")."','Website iskill-Form','".$_REQUEST[sender]."','4','".date("Y-m-d H:i:s")."')";

$result1=mysql_query($query1) or die(mysql_error());

//$fromEmail= $_REQUEST[email];
//$fromEmail="bd@inlinguanewdelhi.com";
$fromEmail="bd@inlinguanewdelhi.com";

$fromName=$_REQUEST[name1];

$message="A new User has Requested for call back under i-Skill Programs<br>The Details are as follows:
<br>Name:".$_REQUEST[sender]."<br>Contact No.:".$_REQUEST[phone]."<br>Email:".$_REQUEST[email]."<br><br>";

//$to="bd@inlinguanewdelhi.com";
$to="sumit@inlinguanewdelhi.com";
$to1="herman@inlinguanewdelhi.com";
$to2="vikasumrao@sify.com";

$subject="iSkill Call Back:".$_REQUEST[sender]."";
            //Set basic detail here			
			//$domain = "panalinks.com";

			//$smtpHost = "mail.$domain";

			//$smtpUser = "subhash@$domain";

			//$smtpPassword = "subhash!";
			
			$domain = "inlinguanewdelhi.com";

		    $smtpHost = "mail.$domain";

		    $smtpUser = "shrikant@$domain";

		    $smtpPassword = "Noida007";

$mail = new PHPMailer();
$mail->IsSMTP(); 

            $mail->Host = $smtpHost;  // specify main and backup server

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

			$mail->Username = $smtpUser;  // SMTP username

			$mail->Password = $smtpPassword; // SMTP password
			
//$mail->IsMail();
$mail->From = $fromEmail;
$mail->FromName = $fromName;

$mail->AddAddress($to, "");
$mail->AddAddress($to1, "");
$mail->AddAddress($to2, "");

$mail->IsHTML(true);               // set email format to HTML
$mail->Subject = $subject;
$mail->Body    = $message;

if(!$mail->Send())
{
    echo "Message could not be sent on mailid: <font color='red'>'".$to."'</font><br>";
	echo "Please check the emailId.<br>";
    //echo "Mailer Error: " . $mail->ErrorInfo;
    //exit;
}

?>