I found a solution. I built two classes called Mailer and secondaryMailer. The mailer class use the default laravel mail that I'm using (mandrill). The secondaryMailer class, uses gmail or whatever driver you want to use. This is the code for the secondaryMailer class
use Illuminate\Support\Facades\Mail;
use Swift_Mailer;
class SecondaryMailer {
public function Send($view, array $data, array $params)
{
// Backup your default mailer
$backup = Mail::getSwiftMailer();
// Setup your gmail mailer
$transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls');
$transport->setUsername('Your-gmail-username');
$transport->setPassword('Your-Password');
// Any other mailer configuration stuff needed...
$gmail = new Swift_Mailer($transport);
// Set the mailer as gmail
Mail::setSwiftMailer($gmail);
// Send your message
Mail::send($view, $data, function($message) use($params)
{
$message->from($params['email'])->to($params['toEmail'])->subject($params['subject']);
});
// Restore your original mailer
Mail::setSwiftMailer($backup);
}
}
This is the post where I found the solution. Thanks to Bogdan
multiple mail configurations