Visite Webhosting Latino, el site sobre alojamiento web.
CDO.Message.1 error 80040213 - Mombu the Microsoft Forum
Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > CDO.Message.1 error 80040213
User Name
REGISTER NOW! Mark Forums Read

sponsored links

1 4th August 21:56
espen torgersen
External User
Posts: 1
Default CDO.Message.1 error 80040213


we've been using CDO to send mail from a custom ASPNET application, but
now it has suddenly (and unexpectedly) stopped working. The error message
returned is (the infamous) "CDO.Message.1 error '80040213' The transport failed to
connect to the server"

The application uses localhost (listening on *all unassigned*) as
SMTP-relay, which in turn is configured to forward mail to a smarthost

In order to debug this, I've created a script (found in the bottom of this post) and dumped it in the
web site's root folder as "sendmail.asp":

When loading http://localhost/sendmail.asp in a browser:
1. When "smarthost" is set to "" and "sendusing" is set to "1", the
mail message is dropped to the mailroot queue folder.
2. When "smarthost" is set to "" (local SMTP ip-addr) and "sendusing"
is set to "2" or...
3. ...when "smarthost" is set to "" (the smarthost) and "sendusing"
is set to "2", IIS returns the following error:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/sendmail.asp, line 30

When executing sendmail.vbs (sendmail.asp as vbscript) from the command line (as local admin):
4. smarthost=localhost, sendusing=1 => mail message is dropped to the mailroot queue folder.
5. smarthost=, sendusing=2 => mail message is dropped to the mailroot queue folder.
6, smarthost=, sendusing=2 => mail sent directly to smarthost, over the internet to recipient.

In cases 1, 4 and 5, I find this in the system eventlog:

source: smtpsvc
type: warning
event id: 4006

Message delivery to the host '' failed while delivering to the
remote domain '<domain_removed>' for the following reason: The remote
server did not respond to a connection attempt.

Setup: : windows server 2003 standard edition running iis 6.0 with www/smtp
SMTP-service is setup to relay from and
Access (anonymous) to SMTP on this box only from and : windows server 200X running lotus domino 6.5
lotus domino is setup to relay from

Anyone got any idea of what is causing this error?

Best regards,
Espen Torgersen

<!-- script start -->
<title>SMTP test program</title>

<!-- script start -->
<script language="vbscript" runat=server>
dim smarthost


Set objEmail = CreateObject("CDO.Message")

objEmail.From = "from@email-addr"
objEmail.To = "to@email-addr"
objEmail.Subject = "Test of SMTP on SMTPSERVER=" & smarthost
objEmail.Textbody = "This is the mail message body."
objEmail.Configuration.Fields.Item ("") = 2
objEmail.Configuration.Fields.Item ("") = smarthost
objEmail.Configuration.Fields.Item ("") = 25
objEmail.Configuration.Fields.Item ("") = cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("") = cdoBasic 'cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("") = "<user>"
''objEmail.Configuration.Fields.Item ("") = "<password>"


<!-- script stop -->
  Reply With Quote

  sponsored links

2 4th August 21:56
External User
Posts: 1
Default CDO.Message.1 error 80040213

Smart hosts are *other* SMTP servers you relay through. Don't enter
anything if you use a local SMTP server or send directly to the SMTP
server for delivery. If you are using a local SMTP server, the
SendUsing parameter can be 1, if not, it's 2.

  Reply With Quote
3 4th August 21:56
espen torgersen
External User
Posts: 1
Default CDO.Message.1 error 80040213

Hi Jeff,

I know what a SMTP smarthost is ;-)
I was referring to the "smarthost" vbscript variable (yes, it has a misleading
name...)in my script - not the IIS/SMTP smarthost - should have taken more care
in pointing that out.

The do***entation at
says that when sending mail via a locally installed SMTP-server, the "sendusing"
parameter should be set to "1" and when sending to a remote SMTP-server,
"sendusing" should be set to "2".

I've played around with my sendmail.asp on a server where CDO works, and as far
as I can tell, CDO will simply ignore the "smtpserver" parameter when "sendusing"
is set to "2" - right?
What I find even more confusing is the fact that I'm perfectly able to send mail
(from my to both and the local SMTP-server's IP when "sendusing" is
set to "2"...why did MS put it into the API in the first place?

The error (from the original post) does only show up when CDO is used in ASP(.NET),
but not when executed on the command line, which leads me to suspect that something
is wrong with the NET framework or IIS or whatever...

I'll try to re-install aspnet on the website - maybe that'll help.

  Reply With Quote

Thread Tools
Display Modes

Copyright 2006 - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -