Support/SmtpTransportFactory.php

coollabsio/coolify · app/Support/SmtpTransportFactory.php · php · Apache-2.0
email

Module exposing: SmtpTransportFactory

// Source: https://github.com/coollabsio/coolify | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace App\Support;

use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream;

class SmtpTransportFactory
{
    public static function fromSettings(object $settings, ?string $localDomain = null): EsmtpTransport
    {
        $mode = self::encryptionMode($settings);

        $transport = new EsmtpTransport(
            formatHostForUrl((string) $settings->smtp_host),
            (int) $settings->smtp_port,
            match ($mode) {
                'none' => false,
                'tls' => true,
             

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key