Avatar of rutc2008
rutc2008
 asked on

SQL Database Mail Office 365 Access error

Since moving over to Office 365 our SQL Database Mail has stopped running. At first i thought i knew what this problem was. As we no longer used our on site exchange server as everything is now running via Office 365. I would simply have to replace the local SMTP path, port to the online Office 365 path. Along with the correct email account and password.

I've logged onto the Office 365 admin portal and retrieved the correct SMTP path entered the path in the SQL Database Mail Configure page, ran a test email but nothing happens. The error i can see within the database mail log is as follows:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 18 (2014-01-14T09:24:37). Exception Message: Could not connect to mail server. (An attempt was made to access a socket in a way forbidden by its access permissions 132.245.194.249:587).
)

Any advice would be appreciated.
Microsoft SQL Server 2005Microsoft 365

Avatar of undefined
Last Comment
rutc2008

8/22/2022 - Mon
Jian An Lim

it mainly because firewall blocking/inspecting the traffic hence stop it.
rutc2008

ASKER
Thanks for the response. I'll get our firewall guys to have a look. I'll let you know what they tell me.
Jeffrey Kane - TechSoEasy

You cannot just point the settings in your SQL app to Office 365 because SQL will not send out via TLS as required by Office 365.

So, instead, you need to configure an SMTP relay.  Follow this article to do just that:
http://blogs.msdn.com/b/momalek/archive/2013/02/25/how-to-configure-sql-database-mail-so-send-emails-using-office-365-exchange-online-a-walkthrough.aspx

Jeff
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
rutc2008

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Kane - TechSoEasy

you never said you had an onsite Exchange Server... so no way we could have known how to help.
rutc2008

ASKER
Figured it myself :)