Файловый менеджер - Редактировать - /home/d46091/udyamonlineregistration.org/client-email.php
Назад
<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'vendor/autoload.php'; $user_pwd = "rzp_live_h9KxRS8Ys88hf0:T2l8S402DcfOzllVPfXvuKjp"; $post_data = array ( "customer" => array ( "name" => $_POST['applicant_name'], "email" => $_POST['email_id'], "contact" => $_POST['mobile_number'] ), "type" => "link", "view_less" => 1, "amount" => (int)$product_price * 100, "currency" => "INR", "description" => "Registration Fee", "reminder_enable" => false, "sms_notify" => 0, "email_notify" => 0, "expire_by" => 1793630556, "options" => array ( "checkout" => array ( "readonly" => array ( "email" => "1", "contact" => "1" ) ) ) ); $header_data = array ( "Content-type: application/json" ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.razorpay.com/v1/invoices/", CURLOPT_USERPWD => $user_pwd, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($post_data), CURLOPT_HTTPHEADER => $header_data )); $response = curl_exec($curl); curl_close($curl); $data = json_decode($response); function generateRandomInvoice($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomInvoice = ''; for ($i = 0; $i < $length; $i++) { $randomInvoice .= $characters[rand(0, $charactersLength - 1)]; } return $randomInvoice; } //custom payment page// $applicant_name = $_POST['applicant_name']; $mobile_number= $_POST['mobile_number']; $email_id=$_POST['email_id']; $rand = generateRandomInvoice(); $host_name = 'udyamonlineregistration.org'; $payment_link = 'https://'.$host_name.'/Payment.php?uFinVsiD='.$rand.'&name='.$applicant_name.'&mobileNumber='.$mobile_number.'&emailId='.$email_id; // $payment_link = $data->short_url; #$payment_link = 'https://pmny.in/vrb0P6D2UoEk'; // Mailer $host_name = $_SERVER['HTTP_HOST']; $website_name = strtoupper($host_name); $mail = new PHPMailer(true); try { $mail->isSMTP(); // $mail->SMTPDebug = 2; $mail->CharSet = 'UTF-8'; $mail->Host = $host_name; $mail->SMTPAuth = true; $mail->Username = 'order@'.$host_name.''; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom('order@'.$host_name.'', $website_name); $mail->addAddress($_POST["email_id"]); $mail->isHTML(true); $mail->Subject = "⚠️Ref : Your ".$_POST['form_name']." Form"; $mail->Body = " Dear <strong>".$_POST['applicant_name']."</strong>, <br><br> Thank you for submitting your application 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> If you have already made payment, then please sit back and relax, your order will be processed and acknowledgement of the same will be sent on your registered email address. <br><br> If you have not yet made the payment, processing of your application will not be done unless you make the payment. Click on the link below to make payment. <br> <a href='".$payment_link."' style='background: #e54f07; color: #ffffff; text-decoration: none; padding: 10px; margin-top: 20px; display: inline-flex;'>Pay Here</a> <br><br> Regards,<br> Team Processing,<br> For Order Status: order@".$host_name." "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка