D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
public_html
/
Filename :
sendemail.php
back
Copy
<?php include('superadmin/include/connection.php'); ?> <?php if(isset($_POST['submit'])) { date_default_timezone_set('Asia/Kolkata'); $name=addslashes($_POST['name']); $email=addslashes($_POST['email']); $phone=addslashes($_POST['phone']); $Courses=addslashes($_POST['Courses']); $postdate=date("Y-m-d"); $posttime=date('H:i:s'); $status='0'; if(mysqli_query($conn,"insert into contact values(NULL,'$name','$email','$phone','$Courses','$postdate','$posttime')")) { ?> <script type="text/javascript"> alert("Thank you for sharing valuable contact!"); window.location="index.php"; </script> <?php } else { ?> <script type="text/javascript"> alert("Error! Data Not Inserted"); //window.location="index.php"; </script> <?php echo mysql_error(); } } //echo '<pre>'; //print_r($_POST);die; ini_set("include_path", '/mnt/home2/ipuco/php:' . ini_get("include_path") ); require_once "/mnt/home2/ipuco/php/Mail.php"; $from = "Sender <contact@ipu.co.in>"; $to="admission@ipu.co.in"; $subject="ipu 2023 sendermail"; $body ="Name : ".$_POST['name'] ."\r\n"; $body.="E-Mail : ".$_POST['email'] ."\r\n"; $body.="Phone : ".$_POST['phone'] ."\r\n"; $body.="Courses : ".$_POST['Courses'] ."\r\n"; $body.= "Hi,\n\nHello,Thank you for contacting us Register now."; $host = "mail.ipu.co.in"; $port = "25"; $username = "contact@ipu.co.in"; $password = "yf)+JYE.Ddkv"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => "mail.ipu.co.in", 'port' =>25 , 'auth' => true, 'username' => "contact@ipu.co.in", 'password' => "yf)+JYE.Ddkv")); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo "<center><strong>Thank you for your enquiry!<br /><br />We will get back to you within 24 Hrs.<br /><br /> Redirecting.....</strong><br /><br /> <img src='loading-spiral.gif'> </center><META HTTP-EQUIV='Refresh' CONTENT='1; URL=http://ipu.admissions.nic.in'>"; } if($_REQUEST) { echo '<pre>'; print_r($_POST);die; $to="indowebhub@gmail.com"; $subject="Enquiry through Website sendmail2"; $body ="Name : ".$_POST['name'] ."\r\n"; $body.="E-Mail : ".$_POST['email'] ."\r\n"; $body.="Phone : ".$_POST['phone'] ."\r\n"; $body.="Courses : ".$_POST['Courses'] ."\r\n"; $header = "From: ".$_POST['email']."\r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text/plain; charset=utf-8\r\n"; $header.= "X-Priority: 1\r\n"; $send_contact = mail($to,$subject,$body,$header); $err_msg="Enquiry sends successfully"; if($send_contact) { echo "<center><strong>Thank you for your enquiry!<br /><br />We will get back to you within 24 Hrs.<br /><br /> Redirecting.....</strong><br /><br /> <img src='loading-spiral.gif'> </center><META HTTP-EQUIV='Refresh' CONTENT='3; URL=https://ipuadmission.com/'>"; } else { echo "ERROR"; } } ?> ?>