Scheduled Mail in asp.net

前端 未结 5 621
渐次进展
渐次进展 2021-01-25 07:54

Hai Guys, My application deals scheduled mail concept (i.e) every morning 6.00 am my users gets a remainder mail about their activities for the day... I dont know how t

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-25 08:32

    If you happen to have it handy (and I assume you do), you can use a SQL Server Agent job to make a request to an ASP.NET page that sends the email.

    Here's some example code:

    http://nicholasclarke.co.uk/blog/2008/01/16/web-request-from-sql-server-via-c/

    Of course, since you're using SQL Server to call CLR code anyway, you could just have that code send out the emails (via System.Net.Mail) rather than requesting a page on IIS to do so. To do this, SQL Server would need:

    • Access to all of the data needed to send the emails
    • Outbound firewall access to send an email
    • CLR code that encapsulates all of the logic needed to know where/what to send.

提交回复
热议问题