"Luis
an****@webmail.co.za" <an*******@discussions.microsoft.com> wrote
in news:4d****************************@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 !