Current File : /home/inlingua/public_html/noida/icentex_noida/admin_fd/send_emailcou.php |
<?php
include("../connection.php");
$conn = mysql_connect($SERVER,$USERNAME,$PASSWORD);
$db=mysql_select_db($DATABASE,$conn);
$query="SELECT cou. * , user.name AS instructor, loc.address, loc.contact FROM ingl_course cou INNER JOIN timesheet_user user ON cou.instructor = user.recNo
INNER JOIN timesheet_location loc ON cou.branch = loc.location where cou.courseid='".$_GET['courceid']."'";
$result=mysql_query($query,$conn);
if(!$result)
{
echo "Data Not Found For This Cource Please Contect To System Administrator.";
return false;
}
while($row=mysql_fetch_array($result))
{
$courseid=$row['courseid'];
$startdate=$row['startdate'];
$enddate=$row['enddate'];
$start_time=$row['start_hour'].":".$row['start_minute'];
$end_time=$row['end_hour'].":".$row['end_minute'];
$branch=$row['branch'];
$language=$row['language'];
$level=$row['level'];
$name_pie=$row['name_pie'];
$courseday=$row['courseday'];
$instructor=$row['instructor'];
$address=$row['address'];
$contact=$row['contact'];
}
//echo "Email=> ". $_GET['email']."<br/> Name=> ".$_GET['name']."<br/> CourceId=> ".$_GET['courceid'];
// please change this to your E-Mail address
//$sendTo = "amod@infocityhosting.com";
//$sendTo = "snware@infocityhosting.in" ;
//$sendTo = "mayanka@infocityhosting.in" ;
$sendTo =$_GET['email'];//"mandeep@inlinguanewdelhi.com";//"admin@inlinguanewdelhi.com";//
//echo $_POST['submit'];exit;
$action = "contact";//$_POST['submit'];
if ($action == "contact") {
$name = "Inllingua new delhi";//$_POST['name'];
$email ="admin@inlinguanewdelhi.com"; //$_POST['email'];"icentex@inlinguanewdelhi.com";
$website= $regno; //$_POST['website'];
$subject = 'Inlingua course confirmation alert.';
$message = "Hi This testing";//$_POST['comments'];
if ($name == "" || $email == "" || $message == "") {
echo "There was problem while sending E-Mail. Please verify entered data and try again!";
return false;
}
$message=" <body>
<p>Dear Mr/Ms.<strong>".$_GET['name']."</strong></p>
<p>This is to bring to your notice that your course <strong>".$level."</strong> having course ID <strong>".$courseid."</strong> has been confirmed and will start on <strong>".date('d-m-Y',strtotime($startdate))."</strong> and end on <strong>".date('d-m-Y',strtotime($enddate))."</strong> at <strong>".$branch." Center </strong>. The course is scheduled to take place regularly on <strong>".$courseday."</strong> from <strong>".$start_time." to ".$end_time. "</strong>. </p>
<p>Your Personal inlingua Executive(PiE) is <strong>".$name_pie."</strong> and your instructor's name is <strong>".$instructor."</strong> </p>
<p>Please complete your admission process before the start date and collect your student ID card and welcome folder from your center at the earliest.</p>
<p>In case you need any assistance please contact your PiE during working hours at <strong>".$contact."</strong> or you may visit the center and speak to the PiE personally. </p>
<p> </p>
<p>We hope you enjoy your classes. </p>
<p>Wishing you the best! <strong style='float: right; ' >".$branch."</strong>
<div style='width:200px;float: right; '> <strong>".$address."</strong></div><br />
<a href='http://www.serverws4.com/fx/i_newdelhi/'>inlingua online learning login</a><br />
<a href='http://www.facebook.com/mylingua'> <img src='http://inlinguanewdelhi.com/icentex/admin_fd/images/fb.png' width='50' height='50' alt='Fallow Us On Facebook' ></a> <br />
Regards,<br />
Inlingua New Delhi. </p>
</body>";
}
$headers = 'From: ' . $name . '<' . $email . ">\r\n" .
'Reply-To: ' . $email . "\r\n" .
'MIME-Version: 1.0' . "\r\n".
"Content-type:text/html;charset=UTF-8" .
'X-Mailer: PHP/' . phpversion();
//echo $subject."Mesage".$message;exit;
if (mail($sendTo, $subject, $message, $headers)) {
echo "Email Send Sucesfully to ".$_GET['name'];
$result = mysql_query("Insert Into tbl_cou_alert_mail (courceid,emailid)values('".$_GET['courceid']."','".$_GET['email']."')",$conn);
return true;
} else {
echo "Email Sending Fail to ".$_GET['name'];
return false;
}
?>