multiple mail configurations

后端 未结 7 654
遇见更好的自我
遇见更好的自我 2020-11-28 07:13

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

7条回答
  •  情深已故
    2020-11-28 07:55

    For Laravel version 7.x you can now state the mail driver to use while sending an email. All you need to configure all your connections & credentials properly in config/mail.php. Once configured, you can specify the name of the driver via mailer() function as below:

    Mail::mailer('postmark')
        ->to($request->user())
        ->send(new OrderShipped($order));
    

    I hope it helps someone.

提交回复
热议问题