Dedicated Server Forum

The Hivelocity Dedicated Server Discussion Forum is a place for Hivelocity clients to meet and chat about all things server. From server promotions to server issues, our technical staff, sales, billing, management and Upper management will be actively involved in these discussions. No question is too big or small, no topic is too stupid to be discussed here. We want all of our clients to feel like this is their home away from home on the net.


 
 
In order to get support you will need to enter your registration details:
 
Please enter your search criteria:
 
 

Dedicated Server Forums by Hivelocity Award winning Dedicated Server hosting > Miscellaneous > Coding Samples » How do I use CDOSYS?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2009, 01:56 PM
Administrator
 
Join Date: Jul 2009
Posts: 578
Default How do I use CDOSYS?

Code:
CDOSYS is a replacement for CDONTS and should be used instead of it. 
CDONTS has been removed from Windows 2003 and is no longer supported 
in Server 2003. A working example is below:

Dim objMsg 
Dim objConfig 
Set objMsg = CreateObject("CDO.Message") 
Set objConfig = CreateObject("CDO.Configuration") 
Dim objFields 
Set objFields = objConfig.Fields 
' Setup server information. Comment out if using localhost
objFields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mysmtpserver.com" 
objFields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objFields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 

' Setup server login information if your server require it. Comment out if using localhost
objFields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 
objFields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "SMTPAUTHUser" 
objFields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "SMTPAUTHPassword" 

'uncomment if using localhost.
'objFields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
'objFields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")="c:\inetpub\mailroot\pickup"

objFields.Update

' Now you can setup message to send 
Set objMsg.Configuration = objConfig 
objMsg.To = "tosomeone@somewhere.com" 
objMsg.From = "fromme@domain.com" 
objMsg.Subject = "Some subject" 
objMsg.TextBody = txMessage 

objMsg.Send
set objMsg = NOTHING

Last edited by HV-Adam; 08-06-2009 at 10:14 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:36 AM.