Knowledgebase: ASP Components
Posted by Paul Woodland on 02 January 2014 01:57 PM

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, although CDONTS can still be used, it should be replaced with a CDOSYS script. You will first need to enable Script Mail on your website so that you can send emails out via our SMTP server using the username and password that will be assigned to you. For detials on this, please see this article: 

How do you use CDOSYS?
The following is an example of using the Message and Configuration components to send a simple email:

        'Create instances of our CDOSYS objects.
        Set mailObj = Server.CreateObject("CDO.Message")
        Set confObj = Server.CreateObject("CDO.Configuration")

        'Configure our information.
        Set fields = confObj.Fields
        fields("") = 2
        fields("") = ""
        fields("") = "YOUR SCRIPT MAIL USERNAME" 
        fields("") = "YOUR SCRIPT MAIL PASSWORD"
        fields("") = 1

        'Configure our test email.
        Set mailObj.Configuration = confObj
        mailObj.From = """Your Name"" <>"
        mailObj.Subject = "This is a test email"
        mailObj.TextBody = "This test email is using CDOSYS to send email with LiquidSix Hosting"

        'Add a recipient address.
        mailObj.To = """Target Name"" <>"

        'We need to catch the error.
        On Error Resume Next
        If (Err <> 0) Then
            Response.Write "There was an error sending the email: " & Err.Description
        End If

(0 vote(s))
Not helpful

Comments (0)