src/Valkyrja/Mail/PHPMailerMail.php
public static function publish(Application $app): void
    {
        // Create a new instance of the PHPMailer class
        $PHPMailer = new PHPMailer(true);

        // Enable verbose debug output
        $PHPMailer->SMTPDebug = $app->debug() ? 2 : 0;
        // Set mailer to use SMTP
        $PHPMailer->isSMTP();
        // Specify main and backup SMTP servers
        $PHPMailer->Host = $app->config()['mail']['host'];
        // SMTP Port
        $PHPMailer->Port = $app->config()['mail']['port'];
        // Enable SMTP authentication
        $PHPMailer->SMTPAuth = true;
        // SMTP username
        $PHPMailer->Username = $app->config()['mail']['username'];
        // SMTP password
        $PHPMailer->Password = $app->config()['mail']['password'];
        // Enable TLS encryption, `ssl` also accepted
        $PHPMailer->SMTPSecure = $app->config()['mail']['encryption'];

        $app->container()->singleton(
            Mail::class,
            new static($app, $PHPMailer)
        );
    }
public static function publish(Application $app): void
    {
        // Create a new instance of the PHPMailer class
        $PHPMailer = new PHPMailer(true);

        // Enable verbose debug output
        $PHPMailer->SMTPDebug = $app->debug() ? 2 : 0;
        // Set mailer to use SMTP
        $PHPMailer->isSMTP();
        // Specify main and backup SMTP servers
        $PHPMailer->Host = $app->config()['mail']['host'];
        // SMTP Port
        $PHPMailer->Port = $app->config()['mail']['port'];
        // Enable SMTP authentication
        $PHPMailer->SMTPAuth = true;
        // SMTP username
        $PHPMailer->Username = $app->config()['mail']['username'];
        // SMTP password
        $PHPMailer->Password = $app->config()['mail']['password'];
        // Enable TLS encryption, `ssl` also accepted
        $PHPMailer->SMTPSecure = $app->config()['mail']['encryption'];

        $app->container()->singleton(
            Mail::class,
            new static($app, $PHPMailer)
        );
    }
Publish the provider.

@param Application $app The application

@return void