Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS doesn't work in XP

Status
Not open for further replies.

davewelsh

Programmer
Jun 26, 2001
71
CA
Hi. I'm actually writing VBScript but I couldn't subscribe to that forum.

I used to use CDONTS in active server pages on a 2000 server. Now I'm working on an XP Server and I've heard that I need to use CDOSYS instead. I've seen many samples of this code but it doesn't work for me. (Perhaps its written for 2000 only?)

This is code from MS to send a webpage via the SMTP server:

Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")

Dim Flds
Set Flds = iConf.Fields

With Flds
' assume constants are defined within script file
.Item(cdoSendUsingMethod) = cdoSendUsingPickup '2 ' cdoSendUsingPort
.Item(cdoSMTPServerName) = MailServer
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "UserName"
.Item(cdoSendPassword) = "Password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = &quot;<local>&quot;
.Item(cdoURLGetLatestVersion) = True
.Update
End With

With iMsg
Set .Configuration = iConf
.To = &quot;PhilMcRevis@hotmail.com&quot;
.From = &quot;PhilMcRevis@hotmail.com&quot;
.Subject = &quot;Hows it going? I've attached my web page&quot;
.CreateMHTMLBody &quot; .AddAttachment &quot;C:\files\mybook.doc&quot;
.Send
End With


There are many variations on this code, but they all give errors when the fields start getting filled in:

ADODB.Fields (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.


Does anyone know how to get this working on an XP Server? I've tested the mail server and I can use it to send email with Outlook Express.
 
oops ignore that first line. I just pasted from the other VB 5 & 6 forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top