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) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "PhilMcRevis@hotmail.com"
.From = "PhilMcRevis@hotmail.com"
.Subject = "Hows it going? I've attached my web page"
.CreateMHTMLBody " .AddAttachment "C:\files\mybook.doc"
.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.
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) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "PhilMcRevis@hotmail.com"
.From = "PhilMcRevis@hotmail.com"
.Subject = "Hows it going? I've attached my web page"
.CreateMHTMLBody " .AddAttachment "C:\files\mybook.doc"
.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.