Multiple email server configuration

Submitted by aglipanci - 4 years ago

Change email configuration on the fly.

use \Swift_Mailer;
use \Swift_SmtpTransport as SmtpTransport;

// Setup a new SmtpTransport instance for Gmail 
$transport = SmtpTransport::newInstance('', 465, 'ssl');

// Assign a new SmtpTransport to SwiftMailer
$gmail = new Swift_Mailer($transport);

// Assign it to the Laravel Mailer

// Send your message

comments powered by Disqus