I configured laravel\'s mail service with mandrill driver. No problems here!
Now, at certain point of my application, I need to send a mail via gmail.
I did
Using only setSwiftMailer
as explained by Bogdan didn't work for me, because then the from
and adress
options where still taken from config/mail.php
. Also it wasn't working with queues.
I created a package called multiMail to solve this.
One can setup the mail adress and host/provider/username/passwort etc in /config/multimail.php
and then one can send the mails using
\MultiMail::from('office@example.com')->send(new MailableDummy()));
\MultiMail::from('contact@otherdomain.de')->send(new MailableDummy()));
or queue it
\MultiMail::from('office@example.com')->queue(new MailableDummy()));