Table of Contents

, , ,

Send mail with PHP Laravel/swiftmailer using Microsoft smtp.office365.com

In .env file change

“MAIL_ENCRYPTION=starttls” to “MAIL_ENCRYPTION=tls”

In conf/mail.php, line 59 set MAIL_FROM_ADDRESS to be same as in .env file MAIL_USERNAME value

'host' => env('MAIL_HOST', 'your-mail-host'),
  'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'your-mail@host.com'),
        'name' => env('MAIL_FROM_NAME', 'Your User Name'),
    ],

.env file

...
MAIL_USERNAME=your-mail@host.com
...

Tested on

See also

References