|
Search:
Advanced search
|
Browse by category:
|
Contact Us |
USING CDOSYS TO SEND MAIL |
|||
Description: Collaboration Data Objects (CDO) for Microsoft® Windows® (Cdosys.dll), is a Component Object Model (COM) component designed to simplify writing programs that create or manipulate Internet messages. CDOSYS is one in a suite of collaborative COM components referred to collectively as CDO. CDOSYS is an integral part of the Windows series of operating systems. USING CDOSYS TO SEND MAIL The Object (CDO.Message) has some simple properties that are essential: .From - E-mail address of the sender .To - E-mail address of the recipient .CC - E-mail address of the CC recipient .Subject - Subject of the message .TextBody - Body of the message in plain text .HTMLBody - Body of the message in HTML .Send - Calling this method the message is sent The following is an example of code to send a simple email: <% Dim sMsg Dim sTo Dim sFrom Dim sSubject Dim sTextBody sTo = "recipient@example.com" sFrom = "sender@example.com" sSubject = "Testing CDOSYS delivery" sTextBody = "This is a test of delivery using CDOSYS" Dim objMail 'Create the mail object Set objMail = Server.CreateObject("CDO.Message") 'Create the config object Set objConfig = objMail.configuration 'Set some configuration options With objConfig.Fields .Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "webmailout.abihosting.com" .Update End With 'Set key properties objMail.From = sFrom objMail.To = sTo objMail.Subject= sSubject objMail.TextBody = sTextBody 'Send the email objMail.Send 'Clean-up objects Set objMail = Nothing Set objConfig = Nothing %> |
|||
Powered by
KBPublisher (Knowledge base software)