✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.138
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/tdtravelandlogistics.com/wp-content/plugins/sendwp/includes//class.mailer.php
<?php

namespace SendWP;

use SendWP\API\Request;

/**
 * A decorater for sending API based transactional email.
 *
 * @TODO Maybe extract formatting methods.
 */
class Mailer implements MailerInterface
{
    protected $phpmailer;
    protected $request;

    public static function factory(&$phpmailer)
    {
        $request = \SendWP\API\Request::create('postmaster');
        $phpmailer = new self($phpmailer, $request);
        return $phpmailer;
    }

    public function __construct($phpmailer, Request $request)
    {
        $this->phpmailer = $phpmailer;
        $this->request = $request;
    }

    /**
     * Check for property/method in $phpmailer.
     */
    public function __get($name)
    {
        if (property_exists($this->phpmailer, $name)) {
            return $this->phpmailer->$name;
        }
        return '';
    }

    public function __call($name, $arguments)
    {
        if (method_exists($this->phpmailer, $name)) {
            return call_user_func([ $this->phpmailer, $name ], $arguments);
        }
        return null;
    }

    public function getAttachments()
    {
        $attachments = $this->phpmailer->getAttachments();

        // Format the attachments, per service requirement.
        $attachments = array_map([ $this, 'formatAttachment' ], $attachments);

        return $attachments;
    }

    public function send()
    {
        $to_emails = array_map([ $this, 'formatEmails' ], $this->getToAddresses());
        $cc_emails = array_map([ $this, 'formatEmails' ], $this->getCcAddresses());
        $bcc_emails = array_map([ $this, 'formatEmails' ], $this->getBccAddresses());

        $args = [
            'body' => [
                'to' => json_encode( (array) $to_emails ),
                'from' => $this->From,
                'from_name' => $this->FromName,
                'subject' => $this->Subject,
            ],
        ];
        
        if('text/html' == $this->ContentType) {
            $args[ 'body' ][ 'body' ] = $this->Body;
            $args[ 'body' ][ 'altbody' ] = $this->AltBody;
        } else {
            $args[ 'body' ][ 'altbody' ] = $this->Body;
        }

        if($reply_to = $this->getReplyToAddresses()){
            /**
             * $reply_to is an array of arrays.
             * [ [ $address, $name ], [...] ]
             * To get a string value for the address, we need to reset it twice.
             */
            $reply_to = reset($reply_to);
            $args['body']['reply_to'] = reset($reply_to);
        }

        if( ! empty( $cc_emails ) ) {
            $args[ 'body' ][ 'cc' ] = json_encode( (array) $cc_emails );
        }

        if( ! empty( $bcc_emails ) ) {
            $args[ 'body' ][ 'bcc' ] = json_encode( (array) $bcc_emails );
        }

        if ($attachments = $this->getAttachments()) {
            $args[ 'body' ][ 'attachments' ] = $attachments;
        }

        // Response is empty...
        $response = $this->request->post($args);

        return true; // Sent by the Service.
    }

    protected function formatEmails($emails)
    {
        return reset($emails);
    }

    protected function formatAttachment($attachment)
    {
        return [
            'filename' => $attachment[1], // $filename per PHPMailer docs.
            'filedata' => file_get_contents($attachment[0]) // $path per PHPMailer docs.
        ];
    }
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
22 Jun 2026 6.38 AM
tdhomesa / tdhomesa
0755
admin
--
19 Dec 2023 9.08 AM
tdhomesa / tdhomesa
0755
api
--
19 Dec 2023 9.08 AM
tdhomesa / tdhomesa
0755
templates
--
19 Dec 2023 9.08 AM
tdhomesa / tdhomesa
0755
activation.php
0.191 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
class.mailer.php
3.294 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
compatibility.php
0.287 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
deactivation.php
0.444 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
functions.php
6.165 KB
3 Aug 2022 6.41 PM
tdhomesa / tdhomesa
0644
hooks.php
0.648 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
interface.mailer.php
0.131 KB
31 May 2022 8.57 PM
tdhomesa / tdhomesa
0644
trustedlogin.php
1.169 KB
13 Apr 2023 7.18 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF