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 (0750) : /home/celkcksm/skmpharma.in/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php // Include PHPMailer classes use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; header('Content-Type: text/plain; charset=utf-8'); // Ensure response is plain text if ($_SERVER["REQUEST_METHOD"] == "POST") { $firstName = htmlspecialchars($_POST['firstName']); $lastName = htmlspecialchars($_POST['lastName']); $email = htmlspecialchars($_POST['email']); $phone = htmlspecialchars($_POST['phone']); $city = htmlspecialchars($_POST['city']); $state = htmlspecialchars($_POST['state']); $course = htmlspecialchars($_POST['course']); // Validate email if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Invalid email format."; exit; } // Create an instance of PHPMailer $mail = new PHPMailer(true); try { // Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'ncriptech1@gmail.com'; // Your Gmail address $mail->Password = 'jigh mrpm wamg kodq'; // Your Gmail App Password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; // Set the sender (user's email from the form) $mail->setFrom($email, $name); // Recipient email (your email to receive the form data) $mail->addAddress('office.skmpharmacy@gmail.com'); // Replace with your email // Email content $mail->isHTML(true); $mail->Subject = 'New Contact Form Submission'; $mail->Body = "You have received a new message:<br><br> <b>First Name:</b> $firstName<br> <b>Last Name:</b> $lastName<br> <b>Email:</b> $email<br> <b>Phone:</b> $phone<br> <b>City:</b> $city<br> <b>State:</b> $state<br> <b>Course:</b> $course<br> "; // Send the email $mail->send(); echo 'ok'; } catch (Exception $e) { echo "error {$mail->ErrorInfo}"; } } else { echo "error"; } ?>