Viewing file: fee_save_request.php (4.13 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require("connection.php");
include 'functions.php';
include 'sendgrid_mail.php';
session_start();
date_default_timezone_set('Asia/Kolkata');
$name = $_POST["name"];
$email_new = $_POST["email"];
$phone = $_POST["phone"];
$course = $_POST["course"];
$message = $_POST["message"];
$subject="Srishti Campus Course Enquiry Request";
/*$to = 'srishticampusteam@srishtis.com';*/
// $to = 'srishticampusteam@srishtis.com';
// $to = 'ajeeshmnmd@gmail.com';
// $headers = 'MIME-Version: 1.0' . "\r\n";
// $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// $headers .= 'From: Srishti <srishticampusteam@gmail.com>' . "\r\n".
// 'X-Mailer: PHP/' . phpversion();
// $output = "<div style='font-size:15px;border-style: outset;'>"
// . "<table style='margin-left:40px;'>"
// . "<tr><td><caption><h4>".$subject."</h4></caption></td></tr>"
// . "<tr><td>Name:</td><td>".$name." </td></tr>"
// . "<tr><td>Phone:</td><td>".$phone."</td></tr>"
// . "<tr><td>Email:</td><td>".$email_new."</td></tr>"
// . "<tr><td>Course:</td><td>".$course."</td></tr>"
// . "<tr><td>message:</td><td>".$message."</td></tr></table></div></br>";
// // create new sendgrid mail
// $email = new \SendGrid\Mail\Mail();
// // specify the email/name of where the email is coming from
// $email->setFrom( FROM_EMAIL, FROM_NAME );
// // set the email subject line
// $email->setSubject( $subject );
// // specify the email/name we are sending the email to
// $email->addTo( TO_EMAIL, TO_NAME );
// // add our email body content
// $email->addContent("text/html", $output);
// // create new sendgrid
// $sendgrid = new \SendGrid( SENDGRID_API_KEY );
// try {
// // try and send the email
// $response = $sendgrid->send( $email );
// } catch ( Exception $e ) {
// // something went wrong so display the error message
// echo 'Caught exception: '. $e->getMessage() ."\n";
// }
//mail($to,$subject,$output,$headers);
// $to1 = $email_new;
$to1 = "srishticampusteam@srishtis.com";
$subject1 = "Srishti-Enrollment Info";
$headers1 = 'MIME-Version: 1.0' . "\r\n";
$headers1 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers1 .= 'From: Srishti <srishticampusteam@gmail.com>' . "\r\n";
$output1 = "<div style='font-size:15px;border-style: outset;'><table style='margin-left:40px;'><tr><td><caption><h4>Student Details</h4></caption></td></tr><tr><td>Name:</td><td>" . $name . " </td></tr><tr><td>Phone:</td><td>" . $phone . "</td></tr><tr><td>Email:</td><td>" . $email_new . "</td></tr><tr><td>Course:</td><td>" . $course . "</td></tr><tr><td>Message:</td><td>" . $message . "</td></tr></table></div></br>";
// create new sendgrid mail
$email = new \SendGrid\Mail\Mail();
// specify the email/name of where the email is coming from
$email->setFrom( FROM_EMAIL, FROM_NAME );
// set the email subject line
$email->setSubject( $subject1 );
// specify the email/name we are sending the email to
$email->addTo( $to1, $to1 );
// add our email body content
$email->addContent("text/html", $output1);
// create new sendgrid
$sendgrid = new \SendGrid( SENDGRID_API_KEY );
try {
// try and send the email
$response = $sendgrid->send( $email );
} catch ( Exception $e ) {
// something went wrong so display the error message
echo 'Caught exception: '. $e->getMessage() ."\n";
}
echo 1;
?>
|