Azure SQL Managed Instance database mail

Zuuber 185 Reputation points
2024-04-03T18:16:29.8933333+00:00

Hi

This is regarding Azure SQL Managed Instance and database mail. Managed Instance is only accessible over Azure VPN, public access is disabled.

Have tried with two different mail servers, confirmed SMTP details are correct.

Database mail error log returns >

Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond IPADDRESS:25)

I have also created an outgoing and inbound NSG rule for port 25.

Priority 150

Port 25

Protocol TCP

Source ANY

Destination ANY

I have also tried adding the IP range of the subnet the managed instance is connected to for source and destination.

Why wont database mail send?

Any help would be greatly appreciated.

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2024-04-03T18:40:42.39+00:00

    @LeonT I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: You are facing an issue with Azure SQL Managed Instance database mail. you have confirmed that SMTP details are correct and have created an outgoing and inbound NSG rule for port 25. However, you are still unable to send database mail.

    Solution: As you mentioned you didn't realize that port 25 is blocked, and you changed port to 587 and now it works.

    you found this here in MS forum https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity?source=recommendations

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution.

    Regards

    Geetha

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Zuuber 185 Reputation points
    2024-04-03T18:35:18.8466667+00:00

    RESOLVED.

    If anyone else has this issue i didnt realise that port 25 is blocked, i changed port to 587 and now it works.

    I found this > https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity?source=recommendations

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.