vbscript to send e-mail to exchange 2007

D

dbguru316

I have the following script to send e-mail through exchange 2007 but I get
the error message "Fields update failed..."

Const cdoSendUsingPort = 2, cdoSendUsingExchange = 3, cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object, strSch As String
.....
Dim varmailboxurl, varsendusername, varsendpassword As String

strSch = "http://schemas.microsoft.com/cdo/configuration/"
varsendusername = DLookup("[sendusername]", "tblEMailSetup")
varsendpassword = DLookup("[sendpassword]", "tblEMailSetup")
varmailboxurl = DLookup("[mailboxurl]", "tblEMailSetup")
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingExchange
.Item(strSch & "mailboxurl") = varmailboxurl
.Item(strSch & "sendusername") = varsendusername
.Item(strSch & "sendpassword") = varsendpassword
.Update
End With
.....
Any ideas? Does this approach even work with exchange 2007?
 

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

Similar Threads

Send email to exchange versus SMTP 1
Sending E-mail 3
Sending E-Mail 11
Send html in body 0
WildCard 16
DoEvents 3
CDO & MailMessage problem 2
Using the CDO object to send email... 3

Top