Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

icomad's avatar

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

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

0 likes
3 replies
Cronix's avatar

The error message is clear

Access denied, traffic not accepted from this IP

So they aren't allowing your IP through. The give a link: http://go.microsoft.com/fwlink/?LinkId=526653

After visiting the link, look up the error code "5.7.708" which states:

5.7.700-749

Access denied, tenant has exceeded threshold

The majority of traffic from this tenant has been detected as suspicious and has resulted in a ban on sending ability for the tenant.

Ensure that any compromises or open relays have been resolved, and then contact support through your regular channel.

So, the way to solve it is to make sure you don't have an open relay on your mail server. I know you're using office as your mail server for this app, but that doesn't mean you don't have an insecure mail server installed on your host that you aren't using. You'll have to contact their support for more info. No one here can clear that up for you as it's MS that's blocking the IP address of your server. Maybe that IP has a bad "reputation", or is in some RBL. You can check for that here: https://mxtoolbox.com/blacklists.aspx and enter your site's IP address.

pauline5's avatar

Even I was also undergoing the same issue. The following article was good and helped me in resolving my query. I have another query. Whenever I am going ahead and trying to sign in to a Microsoft cloud service such as Office 365, Microsoft Azure in my pc, an error message is displayed from ADFS that "There was a problem accessing the site. Try to browse to the site again."I have contacted the help desk and followed out their guidelines as told https://supportprop58.com/office-setup/how-to-login-microsoft-office/ Guide us if anything I have missed out to apply.

Please or to participate in this conversation.