Viewing file: test_mail.php (5.13 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include 'sendgrid_mail.php';
require 'connection.php';
$fname="ajeesh";
$phone="1234567";
$email_new ="ajeeshmnmd@gmail.com";
$email="ajeeshmnmd@gmail.com";
$course="php";
$pay="online";
$amount="1200";
$message="test message";
/* MAIL TO ADMIN */
// $to = "ajeeshmnmd@gmail.com";
// // $to = 'srishticampusteam@srishtis.com';
// //$to ="srishticampusteam@srishtis.com";
// $subject = "Srishti-Enrollment Info";
// /*$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";*/
// $output = "<div style='font-size:15px;border-style: outset;'><table style='margin-left:40px;'><tr><td><caption><h4>New Candidate Details</h4></caption></td></tr><tr><td>Name:</td><td>" . $fname . " </td></tr><tr><td>Phone:</td><td>" . $phone . "</td></tr><tr><td>Email:</td><td>" . $email . "</td></tr><tr><td>Course:</td><td>" . $course . "</td></tr><tr><td>Payment:</td><td>" . $pay . "</td></tr><tr><td>Amount:</td><td>" . $amount . "</td></tr><tr><td>Message:</td><td>" . $message . "</td></tr></table></div></br>";
// /* MAIL TO ADMIN */
// // 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";
// }
$i=1;
/* MAIL TO USER */
$to1 = $email_new;
$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; padding:10px;'> Dear User,<br><br>
// Thank you for choosing Srishti Campus. We have received your Course package purchase request on our portal srishticampus.com <br><br>
// Request Number : SICS ".$i++."".$course."<br><br>
// A confirmation message will be sent on completion of the registration process.<br><br>
// Thank you,<br>
// Srishti Campus Team
// </div>";
$output1 = "<div style='font-size:15px;border-style: outset;'><table style='margin-left:40px;'><tr><td><caption><h4>New Candidate Details</h4></caption></td></tr><tr><td>Name:</td><td>" . $fname . " </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>Payment:</td><td>" . $pay . "</td></tr><tr><td>Amount:</td><td>" . $amount . "</td></tr><tr><td>Message:</td><td>" . $message . "</td></tr></table></div></br>";
/* MAIL TO USER */
// header("Location:enroll.php?id=$course_id&s=Success&l=$lastid");
// $sent = mail($to, $subject, $output, $headers);
// 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";
}
//$sent1 = mail($to1, $subject1, $output1, $headers1);
?>
|