Файловый менеджер - Редактировать - /home/d46091/aadharudyog.org/mail.php
Назад
<?php require("config.php"); session_start(); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; $crm_website = 'AADHARUDYOG.ORG'; if(isset($_POST['vercode'])){ if((empty($_SESSION["vercode"])) || ($_SESSION["vercode"] != $_POST['vercode'])){ die("<script>alert('Invalid Verification Code'); history.back();</script>"); } } require 'vendor/autoload.php'; $applicant_name = urlencode($_POST['applicant_name']); $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); $form_name = urlencode($_POST['form_name']); // Tech Lounge if (isset($_POST['form_id'])&& $_POST['form_id'] == 'udyam_enquiry') { $sql=" INSERT INTO enquiry ( applicant_name, mobile_number, email_id ) VALUES ( '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."' )"; if (!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $ch = curl_init('https://crm2.techlounge.co.in/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=MSME&website='.$crm_website.'&amount=ENQUIRY&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.$form_name.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // -------------------------------------- function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } $post = [ 'api_key' => 123456, 'formId' => $_SESSION["form_id"], 'vendor' => 'TTG', 'business' => 'MSME', 'website' => 'aadharudyog.org', 'amount' => '--', 'status' => 'Unpaid', 'name' => $_POST['applicant_name'], 'mobile' => $_POST['mobile_number'], 'email' => $_POST['email_id'], 'state' => '--', 'formName' => $_POST['form_name'], 'orderId' => 'ENQUIRY-'.generate(), ]; $ch = curl_init('https://newcrm.techlounge.co.in/v1/form-data-send-to-crm'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); // -------------------------------------- $ch = curl_init('https://crm5.in/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=MSME&website='.$crm_website.'&amount=ENQUIRY&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.$form_name.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'udyog-adhaar.in'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@udyog-adhaar.in'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@udyog-adhaar.in", "UDYOG-ADHAAR"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear <strong>".$_POST["applicant_name"]."</strong>, <br><br> Thank you for submitting your request for ".$_POST["form_name"]." on our website. <br><br> This mail is an acknowledgement of successful submission of your application, on our website. This mail does not confirm the payment status against the submitted application. <br><br> Regards,<br> Team Processing,<br> For Queries: info@udyog-adhaar.in "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@udyog-adhaar.in"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Submitted"; $mail->Body = " APPLICANT NAME: ".$_POST["applicant_name"]."<br> MOBILE NUMBER: ".$_POST['mobile_number']."<br> EMAIL ID: ".$_POST['email_id']."<br> "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } echo "<script>alert('Thanks For submiting your enquiry, Our Team Will assist you shortly.')</script>"; echo "<script>setTimeout(\"history.back();\",300);</script>"; }
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка