whoami7 - Manager
:
/
home
/
techyfnq
/
mailer.techinfrareviews.com
/
mailer.segnant.com
/
Upload File:
files >> //home/techyfnq/mailer.techinfrareviews.com/mailer.segnant.com/forgotpassword.ajax.php
<?php session_start(); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/vendor/autoload.php'; require 'configuration.php'; require_once 'includes/common.functions.php'; require_once ('classes/database.php'); require_once ('classes/functions.php'); $sqlObj = new mysqlClass; $funcObj = new funcClass; @sleep($sleepTime); $email = $_GET['email']; if (empty($email)) { die("<strong style='color: red'>Email address is required.</strong>"); } else if (!validate_email ($email)) { die("<strong style='color: red'>Invalid e-mail address."); } $query = "SELECT EMAIL, FULLNAME FROM ##super_user WHERE EMAIL = '{$email}' AND IS_ACTIVE = '1'"; $ResultSet = $funcObj->CustomQuery($query); function replaceEmailVars($body, $emailVar) { $today = date("F j, Y, g:i A"); $body = str_replace('[ABSPATH]', $emailVar['ABSPATH'], $body); $body = str_replace('[EMAIL]', $emailVar['EMAIL'], $body); $body = str_replace('[EMAILHEADER]', $emailVar['EMAILHEADER'], $body); $body = str_replace('[DATETIME]', $emailVar['DATETIME'], $body); $body = str_replace('[FULLNAME]', $emailVar['FULLNAME'], $body); //$body = str_replace('[COMPANYNAME]', $emailVar['COMPANYNAME'], $body); $body = str_replace('[RESETPASSWORDCODE]', $emailVar['RESETPASSWORDCODE'], $body); return $body; } // If there is a record then send an email // otherwise show a message if (count($ResultSet)) { $mail = new PHPMailer(true); $body = file_get_contents('templates/admin.forgotpassword.tpl'); /********* EMAIL SETUP ***************/ global $absPath; $emailVar = array(); $emailVar['ABSPATH'] = $absPath; $emailVar['EMAIL'] = $email; $emailVar['EMAILHEADER'] = 'images/email/header.jpg'; $emailVar['DATETIME'] = date("F j, Y"); $emailVar['FULLNAME'] = $ResultSet[0]['FULLNAME']; $emailVar['RESETPASSWORDCODE'] = sha1($email); $conntion = $sqlObj->mysqlClass(); $query = "SELECT * FROM ##smtp WHERE `DEFAULT` = '1'"; $resultSetSMTP = array(); $resultSetSMTP = $funcObj->CustomQuery($query); $defHOST = $resultSetSMTP[0]['HOST']; $defPORT = $resultSetSMTP[0]['PORT']; $defUSER = $resultSetSMTP[0]['USER']; $defPassword = base64_decode(base64_decode($resultSetSMTP[0]['PASSWORD'])); $defAuth = ($resultSetSMTP[0]['AUTHENTICATION'] == '1') ? 'true' : 'false'; $mail->IsSMTP(); $mail->SMTPAuth = $defAuth; $mail->Host = $defHOST; $mail->Port = $defPORT; $mail->Username = $defUSER; $mail->Password = $defPassword; $mail->SetFrom($defUSER); $mail->SMTPSecure = 'tls'; $mail->isHTML(true); // require_once ('configuration.mailer.php'); $mail->Subject = "Segnant Mailer - Reset Password Request"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->AddAddress($_GET['email']); $body = replaceEmailVars($body, $emailVar); $mail->MsgHTML($body); if($mail->Send()) { echo ' <strong style="color: green">Email sent successfully</strong> '; } else { echo " <strong style='color: red'>Email failed. Problem in mail server. "; } } else { die("<strong style='color: red'>No such user available or is inactive.</strong>"); }
Copyright ©2021 || Defacer Indonesia