8004020F error with CDO.Message

L

Luis andyza

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?
 
R

Rob Collyer

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top