Файловый менеджер - Редактировать - /home/d46091/foodlicenceportal.net/mail1.php
Назад
<?php require("config-annual-return.php"); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); session_start(); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; $crm_website = strtoupper($_SERVER['SERVER_NAME']); date_default_timezone_set('Asia/Kolkata'); $date = date('d-m-Y'); if(isset($_POST['vercode'])){ if((empty($_SESSION["vercode"])) || ($_SESSION["vercode"] != $_POST['vercode'])){ die("<script>alert('Invalid Verification Code'); history.back();</script>"); } } function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } $orderId = generate(13); 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']); $product_price = '4999'; // Tech Lounge if (isset($_POST['form_id'])&& $_POST['form_id'] == 'annual_return_enquiry') { $sql=" INSERT INTO fssai ( form_name, applicant_name, mobile_number, email_id, existing_licence_number, state, total_amount, order_id, form_created_on ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST['existing_licence_number']."', '".$_POST["office_state"]."', '".$product_price."', '".$orderId."', '".$date."' )"; if (!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $api_url = "https://demolounge.in/admin/api_insert_sales.php"; $data = [ 'site_url' => 'https://'.strtolower($crm_website), 'form_name' => $form_name, 'business_area' => 'FSSAI', 'cus_full_name' => $applicant_name, 'cus_mobile' => $mobile_number, 'cus_email' => $email_id, 'state' => $_POST["office_state"], 'order_id' => $orderId, 'payment_amount' => $product_price ]; $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); if (curl_errno($ch)) { throw new Exception('cURL Error: ' . curl_error($ch)); } curl_close($ch); $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website='.$crm_website.'&amount=ANNUAL_RETURN_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); $_SESSION["panel_form_id_2"] = $response; include_once("./editable/submit-form.php"); include_once('./payu/annual-return-payu-submit.php'); // include_once('./nimbbl/create-order-for-annual.php'); // Mailer $mail = new PHPMailer(true); $PayLink = 'https://foodlicenceportal.net/Payment.php?cmpnMail=' . base64_encode($orderId); try { $mail->isSMTP(); $mail->Host = 'foodlicenceportal.net'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@foodlicenceportal.net'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@foodlicenceportal.net", "FOOD LICENCE"); $mail->addAddress("".$_POST["email_id"].""); $mail->addBcc("udyogaadhaaronline.org@gmail.com"); $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> Click on the link below to make payment. <br><br> <a href=".$PayLink." class='btn btn-primary'>Pay Here</a> <br><br> Regards,<br> Team Processing,<br> For Queries: info@foodlicenceportal.net "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@foodlicenceportal.net"); $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(\"location.href = './';\",300);</script>"; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка