Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/indem/lms/
Upload File :
Current File : /var/www/html/mmishra/indem/lms/rpmail.php

<?php
require("classes/PHPMailerAutoload.php");
require("classes/class.phpmailer.php");

$tbl2 = 'leaveRegister';

//--------------------------------------------------------------------------
require("classes/class.smtp.php");
$rs1 = mysql_query("select respemail from $tbl2 where id=$id");
while ($o1 = mysql_fetch_object($rs1)) {
	$email2 = $o1->respemail;
}	
//---------------------------------------------------------------------------
		$mail = new PHPMailer();
		//$mail->SMTPDebug = 4; //telling the class to run SMTP in debug mode
		$mail->IsSMTP(); // telling the class to use SMTP
                $mail->CharSet="UTF-8";
                //Whether to use SMTP authentication
                $mail->SMTPAuth = true;
                $mail->SMTPSecure = 'ssl';
                $mail->Host = 'smtp.gmail.com';
                $mail->Port = 465;
		$mail->FromName = "Prashant";
		$mail->From = "prashantkr@iiita.ac.in";
		$mail->Username = "prashantkr@iiita.ac.in";
		$mail->Password = "";
		//$mail->WordWrap = 80;
		$mail->Subject = "Online Leave Application";
		//$mail->AddAddress("prashantkr@iiita.ac.in","prashantkr@iiita.ac.in");
		$mail->AddAddress("$email2","$email2");
		//$mail->AddCC("dr.a@iiita.ac.in","dr.a");
		//$mail->AddAttachment("invitation09.jpg","invitation09.jpg");


		$rs = mysql_query("select appid,empid,leavefrom,leaveto from $tbl2 where id=$id");
		while ($p = mysql_fetch_object($rs)){
			$appempid = $p->empid;
			$appleavefrom = $p->leavefrom;
			$appleaveto = $p->leaveto;
			$stleavefrom = $p->stleavefrom;
			$stleaveto = $p->stleaveto;
		}	
			$ps = mysql_query("select * from employeeMaster where empid='$appempid'");
			while ($q = mysql_fetch_object($ps)){
				$appname = $q->empname;
			
		}

$msg ="

Dear Sir/Madam,

This is to inform you that owing to personal reasons i have applied leave during $appleavefrom to $appleaveto along with station leave from $stleavefrom to $stleaveto . To look after my work in my absence i have nominated you. you are requested to kindly comment your no-objection to the same.\n ";

<a href="http://website.iiita.ac.in/lms/?pg=rpnoc&id=$id&empid=$empid"><input type='button' name='accept' value='ACCEPT'></a>

$msg = $msg . " -
Thanks
$appname
";

		$mail->Body = $msg;
		if (!$mail->Send()) {
			echo "Mail could not be sent\n Mailer Error: " . $mail->ErrorInfo;
		} else {
			//echo "<pre style='font-size:11px'>$msg</pre>";
		}

		//echo "<pre style='font-size:11px'>$no. $email</pre>";
	//}
//}
?>