473,322 Members | 1,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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?
Jul 19 '05 #1
1 4430
"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 !
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: alex | last post by:
Hi, Does anybody have an idea why is this happening. The following code works great on my development machine (windows 2000 pro), but on the test server (Windows 2000 Server) it can only send...
5
by: Paco | last post by:
I'm having a problem with an ASP page I've made and was hoping someone out there can help. My page sends an email using CDO to a username pulled from a database as follows: With cdoMessage...
6
by: Owen | last post by:
Hi, can somebody help me please... I'm trying to set up a very simple asp page that sends me an email when it runs. This is just to try and get CDOSYS working so I can send out emails from my...
0
by: gariboldo | last post by:
Have all a nice day, I have the following problem: I have in my site a page ASP that contains a form and i'm trying to send it to an email address with the following script: Set cdoConfig =...
2
by: Mario Michela | last post by:
i've been working for 4 days trying to accomplish something that should take 20 minutes.. I have an asp page that take user info, ie name, address phone, email. it sends a copy to email addres A...
0
by: Larry D | last post by:
I have a client with a site that users can register at, we collect their emails, if they have one, in an Access db. I have a page that uses CDOSYS to send messages to those emails but I am getting...
2
by: candywang | last post by:
first , my english is bad~~~I'm sorry! I got some problem. Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") =real ip(remote machine)...
2
by: gduggan | last post by:
I hope someone can help me solve this problem. I have a client who is hosting their website on an Exchange server running Windows Server 2003 OS. They are currently unable to receive email from...
7
by: ayush patel | last post by:
Hi everyone, I am writing ASP code to send email using SMTP.I am getting error '8004020f' at .Send. this seems to be a common error. my SMTP server relays to anonymous email addresses.there is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.