icomad
2 years ago
1954
3
Servers

Office365 Mail integrated in Laravel works on local environment but not in production

Posted 2 years ago by icomad

Hello, I recently bought a domain with an Office365 account on GoDaddy. I have a website hosted on DigitalOcean to which the domain points. The website is built with Laravel and before subscribing to Office365 I used a gmail account for mailing the users and it was working fine, now I'm trying to switch to my new Office365 account but with no success.

I'm using this parameters

MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=my_office365_account
MAIL_PASSWORD=my_password
MAIL_ENCRYPTION=tls

While working on local I get no errors and I can deliver emails with no problem but when I try the same from my server on DigitalOcean I get this error

Expected response code 250 but got code "550", with message "550 5.7.708 Service unavailable. Access denied, traffic not accepted from this IP. For more information please go to http://go.microsoft.com/fwlink/?LinkId=526653

Could any of you point me in the right direction to solve this ? Thank you

Please sign in or create an account to participate in this conversation.