Server IP : 103.191.208.50 / Your IP : 216.73.216.53 Web Server : LiteSpeed System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64 User : celkcksm ( 1031) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, popen, exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/celkcksm/gtsgmbh.ncriptech.com/dev/saltora-apurba/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'php_mailer/Exception.php'; require 'php_mailer/PHPMailer.php'; require 'php_mailer/SMTP.php'; header('Content-Type: application/json'); try { // Sanitize and validate input $fname = htmlspecialchars(trim($_POST['fname'])); $lname = htmlspecialchars(trim($_POST['lname'])); $email = htmlspecialchars(trim($_POST['email'])); $phone = htmlspecialchars(trim($_POST['phone'])); $date = htmlspecialchars(trim($_POST['datepicker'])); $gender = htmlspecialchars(trim($_POST['gender'])); $city = htmlspecialchars(trim($_POST['city'])); $country = htmlspecialchars(trim($_POST['country'])); $c10schoolname = htmlspecialchars(trim($_POST['c10schoolname'])); $c10percent = htmlspecialchars(trim($_POST['c10percent'])); $c102schoolname = htmlspecialchars(trim($_POST['c102schoolname'])); $c102percent = htmlspecialchars(trim($_POST['c102percent'])); $gradcollege = htmlspecialchars(trim($_POST['gradcollege'])); $gradpercent = htmlspecialchars(trim($_POST['gradpercent'])); // Basic validation if (empty($fname) || empty($lname) || empty($email) || empty($phone) || empty($city) || empty($country) || empty($date)) { echo json_encode(['status' => 'error', 'message' => 'All required fields must be filled.']); exit; } $mail = new PHPMailer(true); // Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; // Replace with your SMTP host $mail->SMTPAuth = true; $mail->Username = 'waytoadmissions21@gmail.com'; // Replace with your SMTP username $mail->Password = 'lgle pkre mzzy sebw'; // Replace with your SMTP password or app-specific password $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; $mail->Port = 465; // Recipients $mail->setFrom($email, "$fname $lname"); $mail->addAddress('salbed255@gmail.com'); // Replace with recipient email // Content $mail->isHTML(true); $mail->Subject = 'New Form Submission'; $mail->Body = " <h2>New Form Submission</h2> <p><strong>First Name:</strong> $fname</p> <p><strong>Last Name:</strong> $lname</p> <p><strong>Email:</strong> $email</p> <p><strong>Phone:</strong> $phone</p> <p><strong>City:</strong> $city</p> <p><strong>Country:</strong> $country</p> <p><strong>Date:</strong> $date</p> <p><strong>Gender:</strong> $gender</p> <p><strong>Class 10 School Name:</strong> $c10schoolname</p> <p><strong>Class 10 Percentage:</strong> $c10percent</p> <p><strong>Class 10 + 2 School Name:</strong> $c102schoolname</p> <p><strong>Class 10 + 2 Percentage:</strong> $c102percent</p> <p><strong>Graduation College Name:</strong> $c102schoolname</p> <p><strong>Graduation Percentage:</strong> $c102percent</p> "; $mail->send(); echo json_encode(['success' => true]); } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Email could not be sent. Error: ' . $mail->ErrorInfo]); } ?>