CDO Mail error 438

B

Bill nguyen

The following function gave an error 438 Object doesn't support this
property or method. The same function ran ok on another VB 6. What am i
missing?
Thanks
Bill




objConfig = CreateObject("CDO.Configuration")
Fields = objConfig.Fields
With Fields


Public Function sendCDOMail(ByVal fromAddr, ByVal recipients, ByVal subject,
ByVal bodyPath)
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

objConfig = CreateObject("CDO.Configuration")
Fields = objConfig.Fields
With Fields

.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "exchangeserver"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "webmaster"
.Item(cdoSendPassword) = "intranet"

.Update
End With

objMessage = CreateObject("CDO.Message")
objMessage.Configuration = objConfig
With objMessage

.To = recipients
.From = fromAddr
.subject = subject
.HTMLBody = strMsgBody
.Send

End With
Fields = Nothing
objMessage = Nothing
objConfig = Nothing
End Function
 
C

Chad Z. Hower aka Kudzu

B

Bill Nguyen

I found CDOsys.dll in my machine.
It works fine with VB.NET, but not VB 6.0.
Any idea?
Thanks
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top