PK

ADDRLIN : /home/questend/public_html/domains/integritassolutions.in/
FLL :
Current File : /home/questend/public_html/domains/integritassolutions.in/form_submit.php

<?php
    ob_start();
    //error_reporting(E_ALL ^ E_NOTICE);
    @session_start();
    ini_set('allow_url_include',1);    
    date_default_timezone_set("Asia/Kolkata");
    set_time_limit(600);
    ini_set('max_execution_time',600);

    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\SMTP;
    use PHPMailer\PHPMailer\Exception;

    require 'PHPMailer/src/PHPMailer.php';
    require 'PHPMailer/src/SMTP.php';
    require 'PHPMailer/src/Exception.php';

    class FUNCTIONS {
        public function sendMail($to, $subject, $messagebody) {
            $mail = new PHPMailer();
            try {
                $mail->isSMTP();
                $mail->Host = 'smtp.gmail.com';
                $mail->SMTPAuth = true;
                $mail->Username = 'ankul@integritassolutions.in'; // Replace with your email
                $mail->Password = 'yxfm gosz gxdc ogfe'; // Replace with your password
                /*$mail->Username = 'indusinfotek.vinay@gmail.com'; // Replace with your email
                $mail->Password = 'pojdvqsuozvohirf'; // Replace with your password*/
                $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
                $mail->Port = 587;

                $mail->setFrom('ankul@integritassolutions.in', 'Integritas Solutions');
                $mail->addAddress($to);

                $mail->isHTML(true);
                $mail->Subject = $subject;
                $mail->Body = $messagebody;

                if (!$mail->send()) {
                    return ['success' => false, 'error' => $mail->ErrorInfo];
                }
                return ['success' => true];
            } catch (Exception $e) {
                return ['success' => false, 'error' => $e->getMessage()];
            }
        }
    }

    $response = ['success' => false];

    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $name = !empty($_POST['name']) ? trim($_POST['name']) : '';
        $email = !empty($_POST['email']) ? trim($_POST['email']) : '';
        $message = !empty($_POST['message']) ? trim($_POST['message']) : '';
        $mobile = !empty($_POST['mobile']) ? trim($_POST['mobile']) : '';
        $fsubject = !empty($_POST['subject']) ? trim($_POST['subject']) : '';
        $recaptchaResponse = !empty($_POST['g-recaptcha-response']) ? $_POST['g-recaptcha-response'] : '';

        // Validate reCAPTCHA
        $secretKey = '6Le5ktQrAAAAAHUdHdu95Z-qVB7MapVAQhUeK0qS';
        $recaptchaUrl = 'https://www.google.com/recaptcha/api/siteverify';
        $recaptchaValidation = file_get_contents($recaptchaUrl . '?secret=' . $secretKey . '&response=' . $recaptchaResponse);
        $recaptchaResult = json_decode($recaptchaValidation, true);

        if (!$recaptchaResult['success']) {
            $response['error'] = 'Invalid reCAPTCHA. Please try again.';
            echo json_encode($response);
            exit;
        }

        if ($name && $email && $message) {
            $function = new FUNCTIONS();
            $subject = 'Contact';
            $to = 'ankul@integritassolutions.in';

            $messagebody='<table cellpadding="0" cellspacing="0" style="width:600px; margin:0px auto; color:#7b7b7c; vertical-align:middle; font-family:Arial, Helvetica, sans-serif; font-size:16px;">
                  <tr>
                    <td style="text-align:center;"><a href="#"><img src="" /></a></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td style="color:#333;"><strong>Hi, Admin</strong></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>You have been received a lead from Website.</td>
                  </tr>
                  </table>
                  <table cellpadding="0" cellspacing="0" style="width:600px; margin:0px auto; color:#7b7b7c; vertical-align:top; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:22px;">
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td style="color:#333;" colspan="3"><strong>Contact Details</strong></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                    <tr>
                      <td width="200px;">Name</td>
                      <td width="20px;">:</td>
                      <td width="380px;">'.$name.'</td>
                    </tr>
                    <tr>
                      <td width="200px;">Email Address</td>
                      <td width="20px;">:</td>
                      <td width="380px;">'.$email.'</td>
                    </tr>
                    <tr>
                      <td width="200px;">Subject</td>
                      <td width="20px;">:</td>
                      <td width="380px;">'.$fsubject.'</td>
                    </tr>
                    <tr>
                      <td width="200px;">Mobile</td>
                      <td width="20px;">:</td>
                      <td width="380px;">'.$mobile.'</td>
                    </tr>
                    <tr>
                      <td width="200px;">Message</td>
                      <td width="20px;">:</td>
                      <td width="380px;">'.$message.'</td>
                    </tr>           
                  </table>';

            $result = $function->sendMail($to, $subject, $messagebody);
            $response = $result;
        } else {
            $response['error'] = 'All fields are required.';
        }
    }

    echo json_encode($response);
?>


PK 99
E-SHOP || DASHBOARD
404

Page Not Found

It looks like you found a glitch in the matrix...

← Back to Home