Larck Hosting home page Web design services Web hosting plans Client listing Site map Contact us
 
Sponsored Ads

Setting up the CDONTS email component for your website

To send your email message from a form on your webpage you must use the CDONTS component to format the message for sending. The code on this page is available for your use, take note that this is a bare script and needs to be modified using your mail server variables.

No warranty is implied regarding the operation of this code, this is a very basic script and needs to be configured prior to being used in a production environment.

The colors displayed are for cosmetic purposes only and are not necessary for the completed project.

[back to Windows™ Hosting page]

' Sets CDONTS ASP Component
Set Mailer=Server.CreateObject("CDONTS.NewMail")

' Creates the Body of the Email
Message = "This is line 1 of the body of the email" & VbCrLf
Message = Message & "This is line 2 of the body of the email" & VbCrLf
Message = Message & "This Email was sent at " & now() &"" & VbCrLf

' This is the Subject Line
Subject = "This Email was created with CDONTS"

' This is the To Address
' This Email Address must be an email address
' You have created on your hosting account

ToAddress = ""

' This is the From Address
' This Email Address must be an email address
' You have created on your hosting account

FromAddress = ""

' Collects the Body of the Email
Mailer.Body = Message

' Collects the Subject of the Email
Mailer.Subject = Subject

' Collects the To Address of the Email
Mailer.To = ToAddress

' Collects the From Address of the Email
Mailer.From = FromAddress

' Mails the Email
Mailer.Send