DB Mail issue

Hram Admin 170 Reputation points
2024-11-06T15:41:10.04+00:00

Hello!

Maybe I forgot something... please help me please to understand the following:

If I have some job that must notify email operator upon its (for example) failure - should these email notifications be sent (and received) if DB Mail is stopped?

01-1

02-1

03-1

04

In other words, if - according to the error message in the SQL Agent log - the DB Mail is not working then how do these notifications get delivered to the operator (using the sqlmail account defined in the DB Mail profile)?

Thank you in advance,
Michael

SQL Server | Other
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,566 Reputation points
    2024-11-07T02:46:50.6833333+00:00

    Hi @Hram Admin

    It might be the SQL Server Agent temporarily queuing emails or using an alternate method to send notifications. Please check the Database Mail log to see if there are any queued messages.

    Best regards,

    Cosmog


    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".

    0 comments No comments

  2. Hram Admin 170 Reputation points
    2024-11-07T16:42:47.7033333+00:00

    Hello Cosmog,

    Thank you for the reply!

    I've already checked variouse mail-related tables and haven't found any traces of mail messages that keep being delivered to my mailbox (******@contosos1.net):

    N1

    There are lots of messages in my mailbox from ******@contoso1.net while SQL Server knows nothing about them... I really don't get it... :(

    0 comments No comments

  3. Hram Admin 170 Reputation points
    2024-11-07T17:00:26.2+00:00

    P.S.

    Maybe when DB Mail is disabled only the following will not work:

    EXEC msdb.dbo.sp_send_dbmail

    *@profile_name = 'SQL Database Mail',*  
    
    *@recipients = '******@contoso1.net',*  
    
    *@body = @fullrep,*  
    
    *@subject = @sub;* 
    
    0 comments No comments

  4. Hram Admin 170 Reputation points
    2024-11-08T11:31:23.1333333+00:00

    By the way - DB Mail IS enabled, but SQL Server "thinks" that it is not:

    SQL

    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.