简体   繁体   中英

Laravel 5.4 and office365 company email

I want to use my company office365 email to send email from laravel 5.4.

So I edit my .env like this :

MAIL_DRIVER=smtp
MAIL_HOST=domaine-com.mail.protection.outlook.com
MAIL_PORT=25
MAIL_USERNAME=myemail@domaine.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=myemail@domaine.com
MAIL_FROM_NAME=WebsiteName

I started with default laravel auth system. When I fill the input with email on my database and click send, I've got a success message :

We have e-mailed your password reset link!

But I've got nothing on my email, nothing on my spam or everywhere else.

Did I miss a step ?

Thank for your help

Are you sure your settings are correct there?

I think you should be using port 587 for SMTP for Office 365.

EDIT

Check out this answer also, which has more information: Laravel sending email with Office 365 Email

There is bound to be a small part of your config not set correctly, and it's hard to tell which part, as you've obfuscated the real data (understandably).

you can also use this Mail-Driver: https://github.com/motze92/office365-mail

This send's email from the Graph Rest Api and works better than the Office365 SMTP what gives many times unexpected timeouts and errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM