//  home   //  advanced search   //  news   //  categories   //  sql build chart   //  downloads   //  statistics
 ASP FAQ 
Home
ASP FAQ Tutorials

   8000XXXX Errors
   Alerts
   ASP.NET 2.0
   Classic ASP 1.0
      COM / ActiveX Components
      Forms
      General Topics
      Date/Time Routines
      Email Scripts & Info
      Files/Directories & FSO
   Databases
   General Concepts
   Search Engine Optimization (SEO)

Contact Us
Site Map

Search

Web
aspfaq.com
tutorials.aspfaq.com
classicasp.aspfaq.com

ASP FAQ Tutorials :: Classic ASP 1.0 :: Email Scripts & Info :: Why does CDO.Message give 800C000D errors?


Why does CDO.Message give 800C000D errors?

You might see this: 
 
CDO.Message.1 (0x800C000D) 
The specified protocol is unknown.
 
There are various reasons for this to happen. Here are some code samples to reproduce this error message: 
 
CreateMHTMLBody 
 
This can be caused if you forget the protocol on your URL, or just put a filename. For example: 
 
<!--  
    METADATA  
    TYPE="typelib"  
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library"  
-->  
<%  
    Set cdoConfig = CreateObject("CDO.Configuration")  
 
    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = cdoSendUsingPort  
        .Item(cdoSMTPServer) = "<enter_mail.server_here>"  
        .Update  
    End With  
 
    Set cdoMessage = CreateObject("CDO.Message")  
 
    With cdoMessage  
        Set .Configuration = cdoConfig  
        .From = "from@me.com"  
        .To = "to@me.com"  
        .Subject = "Sample CDO Message"  
        .CreateMHTMLBody "page.asp" 
        .Send  
    End With  
 
    Set cdoMessage = Nothing  
    Set cdoConfig = Nothing  
%>
 
Make sure you get the URL right. CDO.Message does not understand relative URL formats; it has to be the FULL URL. 
 
<% 
    ' ... 
 
    .CreateMHTMLBody "http://server/page.asp" 
 
    ' ... 
%>
 
If your URL is in the correct format but the server cannot be found, you will get: 
 
CDO.Message.1 error '800c0005'  
The system cannot locate the resource specified.
 
If the server is valid but the page cannot be found, you will get: 
 
CDO.Message.1 error '80040218'  
Unknown Error
 
And if you reference a page that has an error, you might get an even less helpful response: 
 
error '8004021a'
 
(No error message text.) 
 
If you have something like: 
 
<% 
    ' ... 
 
    ' note that http is missing a t 
    .CreateMHTMLBody "htp://server/page.asp" 
 
    ' ... 
%>
 
You will get: 
 
CDO.Message.1 error '800401e4'  
Invalid syntax
 
AddAttachment 
 
Many people use .AddAttachment method to add a file to an outgoing message. However, they don't realize that you need to give it a full path, rather than just a filename. The following should reproduce the error: 
 
<!--  
    METADATA  
    TYPE="typelib"  
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library"  
-->  
<%  
    Set cdoConfig = CreateObject("CDO.Configuration")  
 
    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = cdoSendUsingPort  
        .Item(cdoSMTPServer) = "<enter_mail.server_here>"  
        .Update  
    End With  
 
    Set cdoMessage = CreateObject("CDO.Message")  
 
    With cdoMessage  
        Set .Configuration = cdoConfig  
        .From = "from@me.com"  
        .To = "to@me.com"  
        .Subject = "Sample CDO Message"  
        .AddAttachment "file.txt" 
        .TextBody = "This is a test." 
        .Send  
    End With  
 
    Set cdoMessage = Nothing  
    Set cdoConfig = Nothing  
%>
 
CDO.Message does not have any context for the location of the script that is calling it. So it has no idea that the file is supposed to come from the same folder as the script, if that was your intention. Include the full local path to the file (you can still use Server.MapPath here). The following are all valid formats, assuming the files exist: 
 
<% 
    ' ... 
 
    .AddAttachment Server.MapPath("file1.txt") 
    .AddAttachment "d:\file2.txt" 
    .AddAttachment "file://d:\file3.txt" 
 
    ' ... 
%>
 
And no, the same error message isn't raised if you attach a file that doesn't actually exist. If you specify such a filename, you will get: 
 
CDO.Message.1 error '80070002'  
The system cannot find the file specified.
 
And if you try to attach a file from a folder or drive that doesn't exist (e.g. if you made a typo in the path), you will get: 
 
CDO.Message.1 error '80070003'  
The system cannot find the path specified.
 
Make sure IUSR (or the authenticated user) has access to the file(s) and folder(s) you are accessing. Otherwise, you will see this: 
 
CDO.Message.1 error '80070005'  
Access is denied.

Related Articles

Can I get CDO messages to return a read receipt?
Can I use a remote SMTP server with CDONTS.NewMail?
How do I alter the priority / importance of an e-mail message?
How do I prevent my links from wrapping in an e-mail?
How do I put carriage returns into an e-mail?
How do I send e-mail from ASP?
How do I send e-mail from SQL Server?
How do I send e-mail in HTML format?
How do I send e-mail with CDO?
How do I validate an e-mail address?
Should I use form action=mailto: to mail the results of a form?
Where can I get more details about configuring / using CDO?
Why can't ASP handle 80,000 e-mails?
Why do CDONTS messages end up in the badmail folder?
Why do I get 8000900F errors?
Why do I get 80040108 errors?
Why do I get 8004020A errors?
Why do I get 80090020 errors?
Why do I get C00402CE / C00402C7 errors?
Why does CDO.Message give me 8004020F errors?
Why does CDO.Message give me 80040213 errors?
Why does CDO.Message give me 80040222 errors?
Why does my CDONTS mail hang out in the queue or pickup folders?
Why is e-mail to certain domains being rejected?

 

 


Created: 12/17/2003 | Last Updated: 12/17/2003 | broken links | helpful | not helpful | statistics
© Copyright 2006, UBR, Inc. All Rights Reserved. (354)

 

Copyright 1999-2006, All rights reserved.
Finding content
Finding content.  An error has occured...