| Server IP : 50.63.8.194 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT P3NWVPWEB026 10.0 build 17763 (Windows Server 2016) AMD64 User : IWPD_7824(SpiPanel) ( 0) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : G:/PleskVhosts/polyprep.in/mmitshamli.ac.in/home/ |
Upload File : |
<?php
$name = trim($_POST['name']);
// $lname = $_POST['lname'];
$email = $_POST['email'];
$number = $_POST['mobile'];
$message = $_POST['msg'];
$nameb=explode(" ",$name);
$fname = $nameb[0];
$lname = $nameb[1];
// echo $lname;
// die();
include("../admin/connection.php");
$q_ins = "insert into tbl_contact (fname, lname, email, mobile, message, date) values('$fname', '$lname', '$email', '$number', '$message', now())";
if(mysqli_query($dbCon, $q_ins)){
$id_query = "select con_id from tbl_contact where email='$email' order by con_id desc limit 1";
$res_id = mysqli_query($dbCon, $id_query);
$row_id = mysqli_fetch_array($res_id);
$con_id = $row_id['con_id'];
$token_no = "T2022".$con_id;
$msg = $message."<br/><br/> Token Number Is : ".$token_no;
require 'class/class.phpmailer.php';
$mail = new PHPMailer;
$mail->IsSMTP(); //Sets Mailer to send message using SMTP
$mail->Host = 'smtpout.secureserver.net'; //Sets the SMTP hosts of your Email hosting, this for Godaddy
$mail->Port = '80'; //Sets the default SMTP server port
$mail->SMTPAuth = true; //Sets SMTP authentication. Utilizes the Username and Password variables
$mail->Username = 'hr@softproindia.in'; //Sets SMTP username
$mail->Password = 'hr@spi123'; //Sets SMTP password
$mail->SMTPSecure = ''; //Sets connection prefix. Options are "", "ssl" or "tls"
$mail->From = $_POST["email"]; //Sets the From email address for the message
$mail->FromName = $_POST["name"]; //Sets the From name of the message
$mail->AddAddress('mmitshamli@gmail.com', 'Name'); //Adds a "To" address
$mail->AddCC('lokeshrt12@gmail.com', $_POST["name"]); //Adds a "Cc" address
$mail->WordWrap = 50; //Sets word wrapping on the body of the message to a given number of characters
$mail->IsHTML(true); //Sets message type to HTML
$mail->Subject = "Contact/Enquiry"; //Sets the Subject of the message
$mail->Body = $msg; //An HTML or plain text message body
if($mail->Send()) //Send an Email. Return true on success or false on error
{
$mail->IsSMTP(); //Sets Mailer to send message using SMTP
$mail->Host = 'smtpout.secureserver.net'; //Sets the SMTP hosts of your Email hosting, this for Godaddy
$mail->Port = '80'; //Sets the default SMTP server port
$mail->SMTPAuth = true; //Sets SMTP authentication. Utilizes the Username and Password variables
$mail->Username = 'hr@softproindia.in'; //Sets SMTP username
$mail->Password = 'hr@spi123'; //Sets SMTP password
$mail->SMTPSecure = 'lokeshrt12@gmail.com'; //Sets connection prefix. Options are "", "ssl" or "tls"
$mail->From = 'mmitshamli@gmail.com'; //Sets the From email address for the message
$mail->FromName = $_POST["name"]; //Sets the From name of the message
$mail->AddAddress($_POST["email"], 'Name'); //Adds a "To" address
//$mail->AddCC('lokeshrt12@gmail.com', $_POST["name"]); //Adds a "Cc" address
$mail->WordWrap = 50; //Sets word wrapping on the body of the message to a given number of characters
$mail->IsHTML(true); //Sets message type to HTML
$mail->Subject = "Contact/Enquiry"; //Sets the Subject of the message
$mail->Body = $msg;
if($mail->Send()){
header("location:contact.php?msg=Message sent successfully");
}else{
header("location:contact.php?msg=Message sent successfully");
}
}
else
{
header("location:contact.php?msg=Message sent successfully");
}
}else{
header("location:contact.php?msg=Sorry, something went wrong !");
}
?>