Knowledgebase: ASP .NET / ASP
CDOSYS Sample ASP Script
Posted by Arvand Sabetian (Import) on 20 January 2010 06:56 PM
Related Documents:
  1. CDOSYS Parameters that work for sending mail
If you are having issues getting CDOSYS to work properly, please use the following sample script which is confirmed to work on our servers -

<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
   
'This section provides the configuration information for the remote SMTP server.
   
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="127.0.0.1"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   
' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="user@domain.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"
   
ObjSendMail.Configuration.Fields.Update
   
'End remote SMTP server configuration section==
   
ObjSendMail.To = "someone@someplace.com"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "user@domain.com"
   
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
   
ObjSendMail.Send
   
Set ObjSendMail = Nothing
%>

Replace user@domain.com and password with an email account you've already created through the control panel.
(92 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).