Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


CDONTS doesn't work in XP

CDONTS doesn't work in XP

CDONTS doesn't work in XP

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
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 "http://mypage";
      .AddAttachment "C:\files\mybook.doc"
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.

RE: CDONTS doesn't work in XP

oops ignore that first line. I just pasted from the other VB 5 & 6 forum.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close