Looking for best method error handling bad emails (system.web.mail)

Discussion in 'ASP .Net' started by Kevin Spencer, May 19, 2004.

  1. The error message indicates that relaying is prohibited. It says nothing
    about the user's email address being valid.

    Putting a try-catch around it only ignores the error. In other words, no
    email is sent; you just don't find out about it.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.
     
    Kevin Spencer, May 19, 2004
    #1
    1. Advertisements

  2. Kevin Spencer

    Max Guest

    Sometimes I get this error when testing web.mail:
    The server rejected one or more recipient addresses
    The server response was: 473 relaying prohibited. You should
    authenticate first

    This goes away when I simply put a try/catch around sending email, but I'm
    wondering if I can use this to my advantage -- come back to the user saying
    their email is invalid, try again?

    I'm asking if this is a good method, since I'm a little bit hesitant to form
    my business logic around a try/catch -- I'm under the impression try/catch
    is to be used for error handling only.

    -Max
     
    Max, May 19, 2004
    #2
    1. Advertisements

  3. Kevin Spencer

    Max Guest

    I always get that error when it's an email that doesn't exist. Don't ask me
    how it knows... but when I use an email address I know works, it sends just
    fine. Maybe it's just an error coming from the SMTP server, in which case
    the error would be different depending on the SMTP server it's using...

    But you didn't address the question -- I could use try/catch not just to
    ignore it, but to return the user back to the form and ask the user to enter
    a valid email address. But my concern is that I'm now using try/catch for
    actual business logic, not just friendly error message handling.

    -Max
     
    Max, May 19, 2004
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.