8004020F error with CDO.Message

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis andyza@webmail.co.za

    8004020F error with CDO.Message

    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?
  • Rob Collyer

    #2
    Re: 8004020F error with CDO.Message

    "Luis andyza@webmail. co.za" <anonymous@disc ussions.microso ft.com> wrote
    in news:4d2e01c473 cc$6de519b0$a40 1280a@phx.gbl:
    [color=blue]
    > 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?
    >[/color]

    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

    Free Web Design and Development Help, Discussions, tips and Critique!
    ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !

    Comment

    Working...