logo
windows 98 Files sql fonts active server pages templates
Useful Computer Information - Sending an email using CDOSYS

Using CDOSYS

Below you will find a very basic script in order to send email messages from your server that is supporting CDOSYS:


'set the mail-server
Set MyMail = Server.CreateObject("CDO.Message")

'who is the email being sent from?
MyMail.From = "fromemail@email.com"

'who are you sending the email to?
MyMail.To = "email1@email.com;email2@email.com"

'who are you CCing to?
MyMail.Cc = "friend1@address1.com;friend2@address2.com"

'who are you BCCing to?
MyMail.Bcc = "friend3@address3.com;friend4@address4.com"

'what do you want the subject of the email to be?
MyMail.Subject = "This is the email subject"

'how do you want the email body sent if received as text
MyMail.textBody = "This is plain text"

'how do you want the email body sent if received as html
MyMail.htmlBody = "This is bold text

'do you want to add an attachment to the email?
MyMail.AddAttachment "c:\path\file.txt"

'set the level of importance
MyMail.Fields("urn:schemas:httpmail:importance").Value = 2

'send the email and set the object to nothing once more
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing


Sign up for our award-winning newsletter: