QuickStart (Dundas Mailer Control 1.0)
Overview | Properties | Methods
The following source code demonstrates how to send an email with both the QuickSend and the SendMail methods. The difference between the two methods is that SendMail incorporates all functionality of the control, while QuickSend only utilizes some of the control's properties. Please note that this sample sends the email messages with a minimal amount of code so not all of the Mailer control's functionality is demonstrated.
Sending an Email with the QuickSend Method
<%
'most control methods throw an exception if an error occurs so we will use an On Error statement
On Error Resume Next
Dim objMailer 'Mailer control
'create instance of Mailer control
Set objMailer = Server.CreateObject("Dundas.Mailer")
'send email
objMailer.QuickSend "[email protected]","[email protected]","Subject","This is the body."
'you can test for the success/failure of the operation by examining VBScript's Err object here
Set objMailer = Nothing
%>
Sending an Email with the SendMail Method
<%
'most control methods throw an exception if an error occurs so we will use an On Error statement
On Error Resume Next
Dim objMailer 'Mailer control
'create instance of Mailer control
Set objMailer = Server.CreateObject("Dundas.Mailer")
'set Mailer control properties and collection items
objMailer.TOs.Add "[email protected]"
objMailer.FromAddress = "[email protected]"
objMailer.Subject = "Subject"
objMailer.Body = "This is the body."
'send email
objMailer.SendMail
'you can test for the success/failure of the operation by examining VBScript's Err object here
Set objMailer = Nothing
%>