Using Swiftmail to send email in Laravel

  1. Configs must be in .env. Not working in /config/mail.php (Unknown reason)

2. Add ‘stream’ config in config/mail.php, or you won’t be able to send emails on local machine.

3. Debug: /vendor/laravel/framework/src/illuminate/Mail/TransportManager.php

4. Clear config cache. (Optional)

Mail Example

 

Controller to send email

 

Reference:

  1. https://stackoverflow.com/questions/36454920/swiftmailer-php-how-to-disable-ssl-certificate-validation
  2. Add custom subject:
    https://laracasts.com/discuss/channels/laravel/give-an-email-a-subject?page=1