HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/content-sp/work-sp/mail_function.php
<?php

require_once '/var/www/content-sp/work-sp/phpmailer/class.phpmailer.php';
function smtpMail($fromname,$replyto,$title, $subject, $content, $email_id)
{
    include 'sp_config.php';
	$mailDetails = $spConn->query("SELECT username, password,region_host from `wp_aat93akkcv_tt_config` where type='Mail' and status='1'");
    $md = $mailDetails->fetch_assoc();
    // echo $mailDetails->error;

	$mail = new PHPMailer();
	$mail->IsSMTP(true); // SMTP
	$mail->SMTPAuth   = true;  // SMTP authentication
	$mail->SMTPSecure = 'tls';
	$mail->Mailer = "smtp";
	$mail->SMTPDebug = false;
	$mail->CharSet = "utf-8";

	//Ask for HTML-friendly debug output
	$mail->Debugoutput = 'html';
	$mail->Host       = $md['region_host']; // Amazon SES server, note "tls://" protocol
	$mail->Port       = 587;                    // set the SMTP port
	$mail->Username   = $md['username'];  // SES SMTP  username
	$mail->Password   = $md['password'];
	$mail->SetFrom($fromname, $title);
	$mail->AddReplyTo($replyto, $title);
	$mail->Subject = $subject;
	$mail->MsgHTML($content);
	$mail->AddAddress($email_id, $email_id);
	if ($mail->Send()) {
		return 1;
	} else {
		return 0;
	}
}
function smtpMailWht($fromname,$replyto,$title, $subject, $content, $email_id)
{
    include 'wht_config.php';
	$mailDetails = $whtConn->query("SELECT username, password,region_host from `wp_aat93akkcv_tt_config` where type='Mail' and status='1'");
    $md = $mailDetails->fetch_assoc();
    // echo $mailDetails->error;

	$mail = new PHPMailer();
	$mail->IsSMTP(true); // SMTP
	$mail->SMTPAuth   = true;  // SMTP authentication
	$mail->SMTPSecure = 'tls';
	$mail->Mailer = "smtp";
	$mail->SMTPDebug = false;
	$mail->CharSet = "utf-8";

	//Ask for HTML-friendly debug output
	$mail->Debugoutput = 'html';
	$mail->Host       = $md['region_host']; // Amazon SES server, note "tls://" protocol
	$mail->Port       = 587;                    // set the SMTP port
	$mail->Username   = $md['username'];  // SES SMTP  username
	$mail->Password   = $md['password'];
	$mail->SetFrom($fromname, $title);
	$mail->AddReplyTo($replyto, $title);
	$mail->Subject = $subject;
	$mail->MsgHTML($content);
	$mail->AddAddress($email_id, $email_id);
	if ($mail->Send()) {
		return 1;
	} else {
		return 0;
	}
}