SMTP mail, need way of making sure mail is sent

Discussion in 'ASP .Net' started by Curt_C [MVP], May 19, 2004.

  1. Curt_C [MVP]

    Curt_C [MVP] Guest

    can't
    Since SMTP doesn't really have a response, since mail can be delayed, etc,
    there isnt any good way to do that, even if you could, that wouldn't
    guarantee they got it, or opened it, or read it, etc.....
    E-mail really is more of a "hit send and hope it gets there" thing really.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Charlie@CBFC" <> wrote in message
    news:...
    > Hi:
    >
    > I'm working on an e-commerce site. Using the SMTP class, my site sends

    out
    > confirmation messages. It works most of the time, but sometimes raises an
    > error. I need a way of making sure it goes out every time. I thought

    about
    > wrapping a try-catch handler in loop that keeps on retrying if delivery
    > fails. Is this a good idea? If not, what is the best way of handling

    this
    > kind of thing?
    >
    > Thanks,
    > Charlie
    >
    >
     
    Curt_C [MVP], May 19, 2004
    #1
    1. Advertising

  2. "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in news:OKNdc7ZPEHA.272
    @TK2MSFTNGP12.phx.gbl:
    > Since SMTP doesn't really have a response, since mail can be delayed, etc,
    > there isnt any good way to do that, even if you could, that wouldn't
    > guarantee they got it, or opened it, or read it, etc.....
    > E-mail really is more of a "hit send and hope it gets there" thing really.


    You can build in a "confidence rate" though. And many will fail immediately
    and you can certainly catch that.


    --
    Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
    "Programming is an art form that fights back"

    Make your ASP.NET applications run faster
    http://www.atozed.com/IntraWeb/
     
    Chad Z. Hower aka Kudzu, May 19, 2004
    #2
    1. Advertising

  3. Curt_C [MVP]

    Charlie@CBFC Guest

    Hi:

    I'm working on an e-commerce site. Using the SMTP class, my site sends out
    confirmation messages. It works most of the time, but sometimes raises an
    error. I need a way of making sure it goes out every time. I thought about
    wrapping a try-catch handler in loop that keeps on retrying if delivery
    fails. Is this a good idea? If not, what is the best way of handling this
    kind of thing?

    Thanks,
    Charlie
     
    Charlie@CBFC, May 19, 2004
    #3
  4. Curt_C [MVP]

    Bill Guest

    If you are saying the Send() method throws an exception then you don't want
    to loop until it sends because you don't know how long that will take. What
    you should do is have a backup mail server that you can try if the first
    server fails. Another option if the SMTP server is on the same machine you
    could spool the message directly to the pickup directory instead of using
    the SMTP protocol. Doing this should increase the chances of the message
    being delivered. If you can't get this working with System.Web.Mail then
    you may want to take a look at a third party component that supports backup
    SMTP servers like: http://www.quiksoft.com/objects/smtp/

    Bill.
    http://bill.atwill.com/


    "Charlie@CBFC" <> wrote in message
    news:...
    > Hi:
    >
    > I'm working on an e-commerce site. Using the SMTP class, my site sends

    out
    > confirmation messages. It works most of the time, but sometimes raises an
    > error. I need a way of making sure it goes out every time. I thought

    about
    > wrapping a try-catch handler in loop that keeps on retrying if delivery
    > fails. Is this a good idea? If not, what is the best way of handling

    this
    > kind of thing?
    >
    > Thanks,
    > Charlie
    >
    >
     
    Bill, May 19, 2004
    #4
  5. Curt_C [MVP]

    Brad Guest

    If your smtp mail server is on another server consider setting up smtp
    virutal server on the same box as your web server (on your pc when
    developing). Set the smtp virutal server to relay to the actual smtp mail
    server (in win2003 virtual smtp this setting is the "smart host"). What
    this will do for you is pretty much guarantee that your mail will always get
    queued....as long as your web server is up and the smtp service on it is
    running. The beneifit of this is that if the mail server is down or there
    is a network disconnect the email will still queue locally until the mail
    server is available again.

    If you have the benefit of multiple mail servers you can set up your code to
    round robin attempt to the different mail servers. For example, if you
    attempt to send to mail server 1 and a try/catch error is raised then
    attempt to send to server 2 and if server 2 is down...etc. I prefer to
    attempt the local smtp server first as the general logic is that if it's
    down the web site is *probably* down too. We've found, through heavy
    testing, that we can actually loose some emails (they just disappear) if we
    send directly to our mail server and either the email viruswall server
    and/or the attempted smtp mail server is down...in some situations no error
    is raised when this happens: something that took me days to prove out to
    our networking staff. Yet in the same situation, if the email is queued
    locally it stays queued until the mail server is up.

    Don't know if that answers your question but hope it helps.


    Brad



    "Charlie@CBFC" <> wrote in message
    news:...
    > Hi:
    >
    > I'm working on an e-commerce site. Using the SMTP class, my site sends

    out
    > confirmation messages. It works most of the time, but sometimes raises an
    > error. I need a way of making sure it goes out every time. I thought

    about
    > wrapping a try-catch handler in loop that keeps on retrying if delivery
    > fails. Is this a good idea? If not, what is the best way of handling

    this
    > kind of thing?
    >
    > Thanks,
    > Charlie
    >
    >
     
    Brad, May 19, 2004
    #5
  6. Curt_C [MVP]

    Karim Guest

    >> Hi:
    >>
    >> I'm working on an e-commerce site. Using the SMTP class, my site sends

    > out
    >> confirmation messages. It works most of the time, but sometimes raises an
    >> error. I need a way of making sure it goes out every time. I thought

    > about
    >> wrapping a try-catch handler in loop that keeps on retrying if delivery
    >> fails. Is this a good idea? If not, what is the best way of handling

    > this
    >> kind of thing?


    Assuming you have access to your own mail server logs:
    Write a program to check your mail server's operation log against your list
    of outgoing addresses. This is an approach for testing at the end where it
    actually goes out.

    karim
     
    Karim, May 19, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    34
    Views:
    13,309
  2. Replies:
    3
    Views:
    1,118
    Roedy Green
    Jan 24, 2006
  3. Alex Hunsley
    Replies:
    4
    Views:
    3,630
    Tim Williams (gmail)
    Jun 29, 2004
  4. William Connery
    Replies:
    0
    Views:
    279
    William Connery
    Dec 5, 2006
  5. Replies:
    0
    Views:
    571
Loading...

Share This Page