/
var
/
www
/
html
/
stengineers
/
admin
/
api
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once('dbconnection.php'); error_reporting(E_ALL); $action = $_POST['action']; $ref = $_POST['referer']; if($ref=='ezioaws') { function validateData($data) { $resultData = htmlspecialchars(stripslashes(trim($data))); return $resultData; } if($action=="addsubscribe") { $email = $_POST['email']; $dates = date("Y-m-d"); $sql = "INSERT INTO subscriber_details (email,created_at) VALUES ('$email','$dates')"; $sqlres = mysqli_query($con, $sql); if ($sqlres) { require "mailer/PHPMailerAutoload.php"; $mail = new PHPMailer; $mail->IsSMTP(); $mail->Host = 'email-smtp.us-west-2.amazonaws.com'; // Specify main and backup server $mail->Port = 587; // Set the SMTP port $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'AKIA5D4TNZMQ2XY2GLG5'; // SMTP username $mail->Password = 'BBAvJ4EWudcXiHgQieOGX3RHn7sTmb1zXwmBUk0hL/hQ'; // SMTP password $mail->SMTPSecure = 'STARTTLS'; // Enable encryption, 'STARTTLS' also accepted $mail->setFrom('noreply@vebkard.com',"Thank you for subscribing! - Desher"); $mail->AddAddress($email, "Thank you for subscribing! - Desher"); // Add a recipient $mail->IsHTML(true); // Set email format to HTML $mail->Subject = " You're added to our community. "; $mail->Body = "<p>Hi!<br><br> Thanks for signing up!.<br><br>You are now officially subscribed to our blog newsletter.<br> Hereafter, we'll be delivering our latest blog to your inbox.<br><br><br> <b>Thank You!</b><br> Stay In Touch </p> "; if(!$mail->send()) { $json['message']= "We were unable to send your request.Please try again"; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { $json['message']= "Your request has been sent successfuly"; // require "mailer/PHPMailerAutoload.php"; $mail = new PHPMailer; $mail->IsSMTP(); $mail->Host = 'email-smtp.us-west-2.amazonaws.com'; // Specify main and backup server $mail->Port = 587; // Set the SMTP port $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'AKIA5D4TNZMQ2XY2GLG5'; // SMTP username $mail->Password = 'BBAvJ4EWudcXiHgQieOGX3RHn7sTmb1zXwmBUk0hL/hQ'; // SMTP password $mail->SMTPSecure = 'STARTTLS'; $mail->setFrom('ramya@eziosolutions.com',"New Subscriber to Your Newsletter! "); $mail->AddAddress("ramya@eziosolutions.com", "New Subscriber to Your Newsletter! "); // Add a recipient $mail->IsHTML(true); // Set email format to HTML $mail->Subject = "Good News! You have a New Subscriber to your Blog Newsletter. "; $mail->Body = "<p>Good News! <br><br> A new user has been subscribed with the following information.<br> <b>Email :</b> $email<br><br><br>Thanks!<br> <b>Have a great day!</b></p>"; if(!$mail->send()) { } else { } } $json['status']= 'success'; $json['message']= "Your request has been sent successfuly"; }else{ $json['status']= 'failed'; $json['message']= "Failed to Add"; } echo json_encode($json); } if($action=='contactdelete') { $id=$_POST['id']; $sql = "DELETE FROM contact WHERE id='$id'"; $msg = mysqli_query($con, $sql); if($msg) { $json['status']='success'; $json['message']="Deleted Successfully"; } else { $json['status']='failed'; $json['message']="Failed to Delete"; } echo json_encode($json); } }else{ $json['status']='failed'; $json['message']="Access Denied"; echo json_encode($json); } ?>