Espen Torgersen
2005-03-09 11:52:24 UTC
Hi,
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
(10.0.0.2).
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 "127.0.0.1" and "sendusing" is set to "1", the
mail message is dropped to the mailroot queue folder.
2. When "smarthost" is set to "10.0.0.1" (local SMTP ip-addr) and "sendusing"
is set to "2" or...
3. ...when "smarthost" is set to "10.0.0.2" (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=10.0.0.1, sendusing=2 => mail message is dropped to the mailroot queue folder.
6, smarthost=10.0.0.2, 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 '10.0.0.2' failed while delivering to the
remote domain '<domain_removed>' for the following reason: The remote
server did not respond to a connection attempt.
Setup:
10.0.0.1 : windows server 2003 standard edition running iis 6.0 with www/smtp
SMTP-service is setup to relay from 127.0.0.1 and 10.0.0.1
Access (anonymous) to SMTP on this box only from 127.0.0.1 and 10.0.0.1
10.0.0.2 : windows server 200X running lotus domino 6.5
lotus domino is setup to relay from 10.0.0.1
Anyone got any idea of what is causing this error?
Best regards,
Espen Torgersen
<!-- script start -->
<html>
<head>
<title>SMTP test program</title>
<head>
<body>
<!-- script start -->
<script language="vbscript" runat=server>
dim smarthost
'smarthost="127.0.0.1"
'smarthost="10.0.0.1"
smarthost="10.0.0.2"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "***@email-addr"
objEmail.To = "***@email-addr"
objEmail.Subject = "Test of SMTP on SMTPSERVER=" & smarthost
objEmail.Textbody = "This is the mail message body."
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smarthost
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic 'cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "<user>"
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "<password>"
objEmail.Configuration.Fields.Update
objEmail.Send
</script>
</body>
</html>
<!-- script stop -->
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
(10.0.0.2).
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 "127.0.0.1" and "sendusing" is set to "1", the
mail message is dropped to the mailroot queue folder.
2. When "smarthost" is set to "10.0.0.1" (local SMTP ip-addr) and "sendusing"
is set to "2" or...
3. ...when "smarthost" is set to "10.0.0.2" (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=10.0.0.1, sendusing=2 => mail message is dropped to the mailroot queue folder.
6, smarthost=10.0.0.2, 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 '10.0.0.2' failed while delivering to the
remote domain '<domain_removed>' for the following reason: The remote
server did not respond to a connection attempt.
Setup:
10.0.0.1 : windows server 2003 standard edition running iis 6.0 with www/smtp
SMTP-service is setup to relay from 127.0.0.1 and 10.0.0.1
Access (anonymous) to SMTP on this box only from 127.0.0.1 and 10.0.0.1
10.0.0.2 : windows server 200X running lotus domino 6.5
lotus domino is setup to relay from 10.0.0.1
Anyone got any idea of what is causing this error?
Best regards,
Espen Torgersen
<!-- script start -->
<html>
<head>
<title>SMTP test program</title>
<head>
<body>
<!-- script start -->
<script language="vbscript" runat=server>
dim smarthost
'smarthost="127.0.0.1"
'smarthost="10.0.0.1"
smarthost="10.0.0.2"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "***@email-addr"
objEmail.To = "***@email-addr"
objEmail.Subject = "Test of SMTP on SMTPSERVER=" & smarthost
objEmail.Textbody = "This is the mail message body."
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smarthost
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic 'cdoAnonymous ' =0
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "<user>"
''objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "<password>"
objEmail.Configuration.Fields.Update
objEmail.Send
</script>
</body>
</html>
<!-- script stop -->