4

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

Furya
  • 413
  • 5
  • 23

2 Answers2

0

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).

Adam Thomason
  • 1,118
  • 11
  • 23
  • That's definitely the correct port, so we've already fixed part of the issue there. I'll update my answer with further information. – Adam Thomason Jun 05 '18 at 09:48
  • As I want to use my office domain to send email with office365, it's normal to use domaine-com.mail.protection.outlook.com instead of smtp ? – Furya Jun 05 '18 at 10:32
0

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.

brokedid
  • 879
  • 2
  • 10
  • 35