/
var
/
www
/
html
/
stengineers
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once('admin/dbconnection.php'); error_reporting(0); $action = $_POST['action']; $ref = $_POST['referer']; if($ref=='ezioaws') { if($action=='add_enquiry') { $name = $con -> real_escape_string($_POST['name']); $email = $_POST['email']; $mobile = $_POST['mobile']; $company = $con -> real_escape_string($_POST['company']); $country = $con -> real_escape_string($_POST['country']); $pincode = $_POST['pincode']; $product = $con -> real_escape_string($_POST['product']); $message = $_POST['message']; $page = $con -> real_escape_string($_POST['page']); $dates = date("Y-m-d"); $sqlinsert = "INSERT INTO contact (name,email,phone,company,country,pincode,product_name,message,source,created_at) VALUES ('$name','$email','$mobile','$company','$country','$pincode','$product','$message','$page','$dates')"; $sqlinsertres = mysqli_query($con, $sqlinsert); require "mailer/PHPMailerAutoload.php"; $mail = new PHPMailer; $mail->IsSMTP(); $mail->Host = 'smtp.hostinger.com'; // Specify main and backup server $mail->Port = 465; // Set the SMTP port $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'contact@stengineers.com'; // SMTP username $mail->Password = 'Contact@ST24'; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted $mail->setFrom('contact@stengineers.com',"S&T Engineers - Enquiry"); $mail->AddAddress('onlinesupport@stengineers.com', "S&T Engineers - Enquiry"); // Add a recipient $mail->IsHTML(true); // Set email format to HTML $mail->Subject = "Good news! S&T Engineers - Enquiry"; $mail->Body = "<p>Hi, <br><br>A new Enquiry has been Submitted. <br><br> <b>Name:</b> $name<br> <b>Email:</b> $email <br><b>Phone Number:</b> $mobile <br><b>Company:</b> $company <br> <b>Country:</b> $country <br><b>Pin Code:</b> $pincode <br> <b>Product:</b> $product <br><b>Message:</b> $message <br><br><b><em>Take care,</em> </b><br><b><em>Team, S&T Engineers! </em></b> </p>"; if(!$mail->send()) { $json['message']= "We were unable to send your request.Please try again"; $json['status']= "Failed"; } else { $json['message']= "Your request has been sent successfully"; $json['status']= "Success"; } echo json_encode($json); } } else { echo "Access Denied"; } if($ref=='ezioaws') { if($action=='addsubscribe') { $email = $_POST['email']; require "mailer/PHPMailerAutoload.php"; $mail = new PHPMailer; $mail->IsSMTP(); $mail->Host = 'smtp.hostinger.com'; // Specify main and backup server $mail->Port = 465; // Set the SMTP port $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'contact@stengineers.com'; // SMTP username $mail->Password = 'Contact@ST24'; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted $mail->setFrom('contact@stengineers.com',"S&T Engineers - Subscribe"); $mail->AddAddress('onlinesupport@stengineers.com', "S&T Engineers - Subscribe"); // Add a recipient $mail->IsHTML(true); // Set email format to HTML $mail->Subject = "Good news! S&T Engineers - Enquiry"; $mail->Body = "<p>Hi, <br><br>A new Subscribe has been Submitted. <br><br> <b>Email:</b> $email <br><br> <em>Take care,</em> </b><br><b><em>Team, S&T Engineers! </em></b> </p>"; if(!$mail->send()) { $json['message']= "We were unable to send your request.Please try again"; $json['status']= "Failed"; } else { $json['message']= "Your request has been sent successfully"; $json['status']= "Success"; } echo json_encode($json); } } else { echo "Access Denied"; } ?>