Error Sending CDO mail using SMTP
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS and SMTP > Error Sending CDO mail using SMTP




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Error Sending CDO mail using SMTP  
Bill Nguyen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-01-04 09:56 PM

Please take a look at the code below. I kept getting the error message:

CDO.Message.1 error '80040213' - The transport failed to connect to the
server.

Win 2003

IIS 6.0

SMTP configured and pointed to Exchange 5.5 server (mailserver)

I would like to get rid of using schemas.microsoft.com services for
configuration parameters. If you have any example of a workign CDO routine,
please point it to me.

Thank you very much.

Bill



 '***************************************
**************

'********************

sub sendMail(fromAddr, recipients,subject, body)

Const cdoSendUsingMethod = _

"http://schemas.microsoft.com/cdo/configuration/sendusing"

Const cdoSendUsingPort = 2

Const cdoSMTPServer = _

"http://schemas.microsoft.com/cdo/configuration/smtpserver"

Const cdoSMTPServerPort = _

"http://schemas.microsoft.com/cdo/configuration/smtpserverport"

Const cdoSMTPConnectionTimeout = _

"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"

Const cdoSMTPAuthenticate = _

"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"

Const cdoBasic = 1

Const cdoSendUserName = _

"http://schemas.microsoft.com/cdo/configuration/sendusername"

Const cdoSendPassword = _

"http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim objConfig ' As CDO.Configuration

Dim objMessage ' As CDO.Message

Dim Fields ' As ADODB.Fields



Set objConfig = Server.CreateObject("CDO.Configuration")

Set Fields = objConfig.Fields

With Fields

.Item(cdoSendUsingMethod) = cdoSendUsingPort

.Item(cdoSMTPServer) = "mailserver"  ' This is an Exchange server

.Item(cdoSMTPServerPort) = 25

.Item(cdoSMTPConnectionTimeout) = 10

.Item(cdoSMTPAuthenticate) = cdoBasic

.Item(cdoSendUserName) = "userIDr"

.Item(cdoSendPassword) = "password"


.Update

End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage


.To = recipients

.From = fromAddr

.Subject = subject

.HTMLBody = body

.Send

End With

Set Fields = Nothing

Set objMessage = Nothing

Set objConfig = Nothing

end sub







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:26 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register