8004020F error with CDO.Message

Discussion in 'ASP General' started by Luis andyza@webmail.co.za, Jul 27, 2004.

  1. Luis

    Luis Guest

    I use CDO.Message to send e-mail from an asp page (similar
    to the method at http://www.aspfaq.com/show.asp?id=2305).
    One of my testers entered an invalid e-mail address and
    got an 8004020F error.

    Is there a way to trap this error so that I can display a
    better error message to the user and prevent the page from
    crashing?
     
    Luis , Jul 27, 2004
    #1
    1. Advertising

  2. Luis

    Rob Collyer Guest

    "Luis " <> wrote
    in news:4d2e01c473cc$6de519b0$:

    > I use CDO.Message to send e-mail from an asp page (similar
    > to the method at http://www.aspfaq.com/show.asp?id=2305).
    > One of my testers entered an invalid e-mail address and
    > got an 8004020F error.
    >
    > Is there a way to trap this error so that I can display a
    > better error message to the user and prevent the page from
    > crashing?
    >


    put this code:-
    ON ERROR RESUME NEXT

    Just before calling the send method.

    After you have called the send method, use this code:-
    If err.number then
    'an error occurred... prolly invalid email
    'put whatever code you need here
    else
    'the message was sent
    end if
    ON ERROR GOTO 0

    Hope this helps

    --
    Robert Collyer
    www.webforumz.com
    Free Web Design and Development Help, Discussions, tips and Critique!
    ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !
     
    Rob Collyer, Jul 27, 2004
    #2
    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. alex

    CDO error 8004020f

    alex, Oct 3, 2003, in forum: ASP General
    Replies:
    4
    Views:
    200
  2. vvv

    just error 8004020f

    vvv, Nov 5, 2003, in forum: ASP General
    Replies:
    1
    Views:
    156
    Aaron Bertrand - MVP
    Nov 5, 2003
  3. Paco
    Replies:
    4
    Views:
    439
    Jeff Cochran
    Mar 30, 2005
  4. Owen
    Replies:
    6
    Views:
    388
    Yan-Hong Huang[MSFT]
    Feb 20, 2004
  5. gariboldo

    error 8004020F

    gariboldo, Feb 2, 2005, in forum: ASP General
    Replies:
    0
    Views:
    122
    gariboldo
    Feb 2, 2005
Loading...

Share This Page