Play-Asia.com - Buy Video Games for Consoles and PC - From Japan, Korea and other Regions!

ASP - Send Mail with CDONTS.NewMail

 

It is an simple to send email by asp script. The following is an example code for sending email via CDONTS.NewMail component.

	Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

objCDOMail.From = strFrom
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody

objCDOMail.Cc = ""
objCDOMail.Bcc = ""
objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High)
objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

objCDOMail.BodyFormat = 0 ' CdoBodyFormatHTML

'Outlook gives you grief unless you also set:
'objCDOMail.MailFormat = 0 ' CdoMailFormatMime

objCDOMail.Send

Set objCDOMail = Nothing

Where...

From is a sender email address
To is a email address who will receive this email
Subject is a email's subject
Body is a email's content

Cc (Carbon Copy) is a email address for who will receive this copy email in an Cc type
Bcc (Back Carbon Copy) is a email address for who will receive this copy email in an Bcc type
Importance is a mail emergency level subject to 3 levels (0=Low, 1=Normal, 2=High)
AttachFile is about to set the file sending with this email

BodyFormat is a type of this email's content format subject to 2 types (0=Text, 1=HTML)

Finally 'Send' function will let the email submit to the destination address

 

 
Visitor Review Write a review
No visitor review for this page yet
Write a review
Rating:
Text:
Name:
Email:
(optional)
 
Code:
 

Search:
Shopping Store Online
Clothes (25)
Gift shop (69)
Hand-made (27)
Luxuries (47)
Others (42)
Programming Tutorial
ASP
Ad Rotator Component
Content Linking Component
Send Mail with CDONTS.NewMail
The Server Object
Using Cookies
CSharp (29)
HTML (10)
JavaScript (6)
Photoshop (9)
PHP (11)
Entertainment
Anime (6)
E-Cards (12)
Games (20)
Music (7)