473,657 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4497
"Luis an****@webmail. co.za" <an*******@disc ussions.microso ft.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
40910
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 emails to addresses on our domain. If I specify other address I just get a 8004020f error message. The smtp server I'm trying to send is on a separate machine (Windows NT Server). I think it has something to do with web server configuration, or even...
5
3259
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 Set .Configuration = cdoConfig .From = "Admin <admin@MyCompany.com>" .To = rs("USERName") & "@MyCompany.com"
6
15578
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 website. Everything is fine right up until I execute the ".Send" method. What could be wrong? What does the error mean? The output from the source below is: "test1 error '8004020f'
0
1512
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 = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mail.server"
2
6545
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 and sends a reciept to site visitor. i have it working on 1 SBS 2003, but i get Error 8004020f on a second client's machine.. i'm using cdo, sendusing = 2 (smtp via network). i've tried both using and not using authentication w/ username and...
0
3451
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 "error '8004020f" when I do this. About 75% of the members have emails so some email fields in the db are empty. One issue with my webhost is that I cannot send by CDOSYS more than 99 emails at a time, so I select all emails where the ID is less...
2
2268
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) Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 ...
2
2013
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 clients through the "Contact Us" form and their client gets the following error message in the browser: error '8004020f' /WA_Universal_Email/CDOSYS_JS.asp, line 146 The Contact Us form email was working as of December 14, 2007. The client...
7
5610
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 no firewall or proxy set up that can stop these mails to be sent. Infact i have seen the SMTP LOG FILE and (i dont know exactly what it says)i think it is sending the mail.see below this is my SMTP LOG FILE.
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.