صفحة جديدة 1

 
Make Money Webmaster Tools Articles Directory PHP Scripts CGI Scripts Contact Us
صفحة جديدة 1

Articles Directory

Forex Articles

Webmaster Free Tools

Partners

Sending an email with ASP using CDONTS
 


Sending an email with CDONTS

There are times in ASP when you would like to send emails.... scary!! Without jumping through hoops, I will endeavour to explain one of the many methods of doing so.

As most of you know, ASP is a technology resident on Windows NT Servers (It is possible to run ASP under Linux, Unix but we wont go into that here). With ASP running on a Windows box, we have access to something called 'Collaborative Data Objects for NT Server'.

For reasons of keeping things simple, this is always referred to as CDONTS. This object is one of many used for sending emails from ASP, but is the only object we have access to by default as it is installed along with IIS.

Ok... I'm sure you all can't wait to send yourself an email, so lets get on with it.

Take a look at this code:-<%
Set Mailer = Server.CreateObject("CDONTS.Newmail")
'We have created a instance of the object... lets do something with it.
Mailer.To = "youremail@yourdomain.com"
Mailer.From = "fromaddress@yourwebsite.com"
mailer.Subject = "CDONTS Example"
Mailer.Body = "Hello me!!"
'The object now has all the info it needs... lets send it.
Mailer.Send
%>

If we were to run the above code and check our inBox we will have a very basic email.

Luckily for me... the above example needs very little explanation except maybe the first line.
To use the CDONTS object, we must first create an instance of it. An instance is merely generating a copy of the object and giving it any name we want (in this case Mailer).

The CDONTS object has numerous properties (things it needs to know, or things you can find out) and a few Methods (Methods perform an action of some kind).

This list below is not meant to confuse you... it is purely for your reference. We shall cover sending more advanced email with CDONTS using some of the properties and methods (Including HTML emails) in a future article.

Happy Email Sending!!

CDONTS Properties:-

To: A string containing an email recipient address
From: To specify the senders address
CC: Carbon Copy recipient address
BCC: Blind Carbon Copy recipient address
Body: The text of the email we want to send
Importance: a number to specify message priority. 0 = low, 1=normal (default), 2 high
Subject: Used to specify the Subject line of the email
Version: This is used to retrieve the Version information of the CDONTS object
ContentBase: This property sets a base for all URLs in the message body (Used only when sending HTML emails)
ContentLocation: This property sets an absolute or relative path for all URLs in the message body(Used only when sending HTML emails)
MailFormat: Used to specify the encoding of the email. 0 = MIME format, 1= Plain text (default)
BodyFormat: This is used to set the text format of the email. 0=HTML, 1= Plain text (default)
Value: This property allows you to set additional mail headers.

CDONTS Methods:

Send: This simply send the email
AttachFile: This method adds an attachment to the message by reading a file.
AttachURL: Adds an attachment to the message and associates a URL with the attachment.
SetLocaleIDs: Sets identifiers that define locale

Rob Collyer, experienced with 20 years programming knowledge and site administrator of www.webforumz.com - Copyright 2003-2004

More Affiliate Articles:

Articles 1 |  Articles 2 | Articles 3 | Articles 4 | Articles 5 | Articles 6

 
[an error occurred while processing this directive]

صفحة جديدة 1
Online Survey Programs:

 Scripts

Software

صفحة جديدة 1
Forex Brokers

Forex Trading eBooks

Make Money Ideas

Make Money Contact Us

 

دليل الصحة الجنسية - الموسوعة الصحية والثقافة الجنسية - صحة المرأة العربية - تسالى وصور واغانى عربية - اربح مع جوجل أدسنس - العاب وصور واغانى للتحميل مجانا أجمل الصور والبرامج المجانية - مكتبة البرامج والالعاب والصور - Work at Home and Make Money

 

Make Money | Contact Us

Copyright © 2002 - 2005 2work-online.com

 

eXTReMe Tracker