Subject: CDO.Message.1 error '80040213'
Posted By: kalunalan Post Date: 11/14/2003 1:49:36 AM
Dear all,

I got a problem when using ASP to call a remote smtp service to send an email through the web and find the following error.

===================================================
CDO.Message.1 error '80040213'

The transport failed to connect to the server.
===================================================

Part of the VBScripts replaced with my remote smtp and email address.
======================================================================
' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPort = 2

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    'ToDo: Enter name or IP address of remote SMTP server.
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "<changed to remote smtp server>"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10  
    .Update
End With

' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' Apply the settings to the message.
With iMsg
    Set .Configuration = iConf
    .To = "<changed to my email address>" 'ToDo: Enter a valid email address.
    .From = "<changed to my email address>" 'ToDo: Enter a valid email address.
    .Subject = "This is a test CDOSYS message (Sent via Port 25)"
    .HTMLBody = strHTML
    .Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

MsgBox "Mail Sent!"
======================================================================



Server configuration:
Win 2000 advanced server with sp3
IIS 5.0 without starting SMTP service

1. Can anyone help me?

2. One more question.
Can I use CDOSYS (Not CDONTS) in windows 2000 while using remote SMTP service by using ASP?

Thanks in advance.
Alan

Go to topic 6472

Return to index page 1006
Return to index page 1005
Return to index page 1004
Return to index page 1003
Return to index page 1002
Return to index page 1001
Return to index page 1000
Return to index page 999
Return to index page 998
Return to index page 997