Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

CDONTS doesn't work in XP

davewelsh (Programmer) (OP)
10 Oct 01 23:08
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 "http://mypage";
      .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.
davewelsh (Programmer) (OP)
10 Oct 01 23:09
oops ignore that first line. I just pasted from the other VB 5 & 6 forum.

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!

Back To Forum

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