ASP.NET MVC Auto Send Email Notification when a table column has value

ika palad 86 Reputation points
2022-01-12T02:46:04.597+00:00

Hello Community,

I'm trying to send an email notification when a certain table field from a sql has a value using asp.net mvc. I have no idea what to start please guide me. Thank you!

Developer technologies ASP.NET Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,096 Reputation points
    2022-01-12T06:40:32.97+00:00

    Hi @ika palad ,
    As far as I think,MS SQL have the ability to automatically send emails. You could create a store procedure. What the stored procedure does is checks and pulls the table column has value. If there are any, it formats the body content of the email and stores it in a variable @tableHTML.

    Then it sends the email(s) using msdb.dbo.sp_send_dbmail command providing the relevant parameters. Please note that you will need to have a email sending profile already configured on your SQL Server. This can be done using Database Mail Configuration Wizard.

    Best regards,
    Yijing Sun


    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.

    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.