User Tools

Site Tools


wiki:send_mail_php_laravel_swiftmailer_using_microsoft_smtp_office365

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

wiki/send_mail_php_laravel_swiftmailer_using_microsoft_smtp_office365.txt · Last modified: 2021/04/08 15:34 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki