For Programmers: Free Programming Magazines  


Home > Archive > ASP > July 2004 > 8004020F error with CDO.Message









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author 8004020F error with CDO.Message
Luis andyza@webmail.co.za

2004-07-27, 8:55 am

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

2004-07-27, 8:55 am

"Luis andyza@webmail.co.za" <anonymous@discussions.microsoft.com> wrote
in news:4d2e01c473cc$6de519b0$a401280a@phx.gbl:

> 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 !
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com