sending emails that are triggered off entries in a table on sql server

Last post 07-02-2008 1:13 AM by anzer. 4 replies.

Sort Posts:

  • sending emails that are triggered off entries in a table on sql server

    07-01-2008, 9:11 AM
    • Member
      38 point Member
    • aspd
    • Member since 08-26-2007, 9:40 PM
    • Posts 520

    Hi All.

    I am designing a asp.net website and there is a part that requires automatic email sending to users for whatever reason. So as far as i can see there are 2 options:

    1. To either send those emails as part of the asp.net code as soon as it urges that requirement.

    Disadvantage to this i think is that if the email is not sent for whatever reason then it can be problematic and will need to be logged in the database for later resending.

    2. When ever the need arises in asp.net code to send an email, a new row should be added to a table in the sql server database. A small program should be designed that will hit the database every so often, i.e. every 10 mins and send that email.

    Any ideas? Suggestions?
     

  • Re: sending emails that are triggered off entries in a table on sql server

    07-01-2008, 9:40 AM
    Answer
    • Contributor
      6,605 point Contributor
    • anzer
    • Member since 10-19-2004, 12:00 AM
    • UAE
    • Posts 1,322

    In most case the first option will work perfectly.. You should always keep a log for what ever error happened  in the site.. And as you said you can use this log to resend the mails if necessary in a scheduled manner..

    So a combination of your options will work great..

    Note : If you are getting too much errors when sending  out the mails in the first place,, you should investigate the reason.. If everything goes well (the server and your software) the email will work without any errors.

    If this post was useful to you, please mark it as answer.

    ClientSideAsp.Net | Blog
  • Re: sending emails that are triggered off entries in a table on sql server

    07-01-2008, 5:30 PM

     The first option is significantly easier; both to implement and to deploy.

     The second option is more scalable and fault tolerant.
     

    Liam McLennan
    Eclipse Web Solutions
    liam@eclipsewebsolutions.com.au
    http://www.eclipsewebsolutions.com.au
  • Re: sending emails that are triggered off entries in a table on sql server

    07-01-2008, 5:39 PM
    • Member
      38 point Member
    • aspd
    • Member since 08-26-2007, 9:40 PM
    • Posts 520

     ok, so should i do a combination of both? i.e send the email where needed in the asp.net code and if fails then put it in the db for it to be sent. or should i just dump it all in the db and they can all be sent together. i think putting it in the db and sending it all at once is much better. what do you think?

  • Re: sending emails that are triggered off entries in a table on sql server

    07-02-2008, 1:13 AM
    • Contributor
      6,605 point Contributor
    • anzer
    • Member since 10-19-2004, 12:00 AM
    • UAE
    • Posts 1,322
    In my opinion the combination of both is the best and fault tolerant way even though it takes more effort..

     

    If this post was useful to you, please mark it as answer.

    ClientSideAsp.Net | Blog
Page 1 of 1 (5 items)