hi all,
i am newbie here. i was trying to send mail from ASP, but i encountered the error as below:-
CDO.Message.1 (0x80040213) The transport failed to connect to the server.
i already google about the error and tried to fix error, but seems like the error unable to solve.
Hope that someone can help me with the error. thanks a lot in advance.
below are the codes that i applied....
i am newbie here. i was trying to send mail from ASP, but i encountered the error as below:-
CDO.Message.1 (0x80040213) The transport failed to connect to the server.
i already google about the error and tried to fix error, but seems like the error unable to solve.
Hope that someone can help me with the error. thanks a lot in advance.
below are the codes that i applied....
Code:
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%
'Const cdoSendUsingMethod = _
' "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingMethod1 = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort1 = 2
Const cdoSMTPServer1 = _
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort1 = _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout1 = _
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate1 = _
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic1 = 1
Const cdoSendUserName1 = _
"http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword1 = _
"http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod1) = cdoSendUsingPort1
.Item(cdoSMTPServer1) = "smtp.gmail.com."
.Item(cdoSMTPServerPort1) = 465
'gmail also .Item(cdoSMTPServerPort1) = 465
.Item(cdoSMTPConnectionTimeout1) = 10
.Item(cdoSMTPAuthenticate1) = cdoBasic1
.Item(cdoSendUserName1) = "me@gmail.com"
.Item(cdoSendPassword1) = "xxxxxxxx"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "me@yahoo.com"
.From = "me@gmail.com"
.Subject = "SMTP Relay Test"
.TextBody = "SMTP Relay Test Sent @ " & Now()
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>