SQL Server Database Mail doesn't work 100% of the time

Nadun 1 Reputation point
2021-12-20T00:00:30.857+00:00

Hi,

I have set up Database mail with a Microsoft Office 365 email account. It used to work flawlessly for many years and I noticed I am missing some email notifications couple of months ago and it's getting worse. When I do a test email, it delivers. Only fails sometimes which is not good as I use this function to inform me and my clients of events.

Here is an image of the log
https://ibb.co/r7T7WtC

select @@veriosn
Microsoft SQL Server 2017 (RTM-CU22-GDR) (KB4583457) - 14.0.3370.1 (X64)   Nov  6 2020 18:19:52   Copyright (C) 2017 Microsoft Corporation  Standard Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor) 

I am on an Azure Virtual machine with SQL server installed.

Any help would be appreciated.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,914 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-12-20T03:31:18.717+00:00

    Hi Nadun-5457,

    Welcome to Microsoft Q&A.
    Azure doesn't offer smtp servers by default. You have to use SendGrid email delivery service that supplies your virtual machine with an SMTP relay.
    Please refer to SQL Server Database Mail configured with the Send Grid Email Service and Configure Database Mail on SQL Server Azure VM using T-SQL which might help.

    Best Regards,
    Amelia


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.