06 Sep 2010 
Support Center » Knowledgebase » How to send email using CDOSys in Windows ASP.
 How to send email using CDOSys in Windows ASP.
Solution

CDOSYS is a server-side component that can be used to send emails from our mail servers. 

CDOSYS was designed to replace CDONTS on modern server systems, it should be replaced with a CDOSYS script.

How do you use CDOSYS?
You can use the following ASP code for sending email using CDOSYS in ASP.

<%

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
   
   
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com"

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") =
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   

' if you want to use authentication
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
   
ObjSendMail.Configuration.Fields.Update
   
   
ObjSendMail.To = "someone@someone.net"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "someone@someone.net"
   
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
   
ObjSendMail.Send
   
Set ObjSendMail = Nothing

%>




Article Details
Article ID: 187
Created On: 14 Sep 2009 02:38 PM

 This answer was helpful  This answer was not helpful

 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Troubleshooter | News | Downloads
Language:

Help Desk Software By Kayako SupportSuite v3.50.06