<?php
    try {
        // $dMessageTransport = (new Swift_SmtpTransport(EMAIL_SMTP, 587))
        $dMessageTransport = (new Swift_SmtpTransport('localhost', 587))
            // ->setUsername('bids@bigtimberbuilders.com')
            // ->setPassword('81caramelapples39')
            // ->setStreamOptions(array('ssl' => array('allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false)))
            // ->setEncryption('ssl')
        ;
        $dMessageMailer    = new Swift_Mailer($dMessageTransport);
        $dMessageSubject   = 'Client Portal Email Test';
        $dMessage          = (new Swift_Message($dMessageSubject));

        $dTo['lambo117@gmail.com'] = 'Email Tester';

        ob_start();
?>
            <h3>Portal Email Test</h3>
            <p>Click the link below to login to your Client Portal. The link is valid for 30 minutes.</p>
            <p>Test</p>
<?php
        $dMessageHtml = ob_get_clean();

        $dMessage->setFrom([EMAIL_FROM_ADDRESS => 'BTB Client Portal'])
            ->setTo($dTo)
            ->setBody($dMessageHtml, 'text/html')
        ;

        $dMessageResult = $dMessageMailer->send($dMessage);
    } catch ( Exception $e ) {
        echo "<pre>";
        print_r($e);
        echo "</pre>";
    }
?>