affordable web development services
| About Us | Services | Download | Order | Support | Subscribe to News Feed Follow us on Twitter Join us on Facebook |
 

ASP Mail Component v2.0.2 - Documentation

Table of Contents

Description

ASP Mail Component is ActiveX component designed to allow e-mail sending from Active Server Pages (ASP) or any other software capable of using ActiveX components. With this component installed you can send simple text E-mail message as well as HTML e-mail with attachments and multiple recipients. Other useful features are also supported.

Features

System Requirements

OS:

Web Server:

Installation Instructions

After receiving ASP Mail Component distribution package:

  1. Extract all files from zip file to temporary directory
  2. Run Setup.exe
  3. Follow instructions of the installer
  4. Test installation with one of the examples found in the archive

Email object

Description

Object allowing E-mail sending.

Syntax:

VBasic:

Set Mailer = Server.CreateObject("SoftComplex.Email")

JScript:

var Mailer = Server.CreateObject("SoftComplex.Email");

Properties:

string Bcc

Blind carbon copy recipient(s) for the message. To specify multiple recipients use coma as separator. e.g.: [email protected], [email protected] or "Jim Smith" <[email protected]>, "John Smith" <[email protected]>

string Body

Message body text

string BodyHtml

Message body html. The same as Body property but when you will assign a value to this property it will set message ContentType to text/html as well

string Cc

Carbon copy recipient(s) for the message. To specify multiple recipients use coma as separator. e.g.: [email protected], [email protected] or "Jim Smith" <[email protected]>, "John Smith" <[email protected]>

string CharSet

Message charset

int ClearOnSend

Allowed values: 0, 1, 2. If 1 will clear Cc, Bcc and Recipients on message sent, if 2 will clear whole message on sent

string ContentTransferEncoding

The MIME encoding for the message using on message transmission. Allowed values: 7bit, 8bit, quoted-printable, base64, binary. Default: 8bit

string ContentType

MIME media type and subtype for the message. e.g: text/plain text/html text/xml

string Encoding

Message Body Encoding. Allowed values: MIME, PlainText, Default. Default: Default

string From

Message Author email address. e.g: [email protected] or "Jim Smith" <[email protected]>

string HeloName

A string that represents the name of the client connection to the SMTP server using either the EHLO or HELO command. If empty local system name will be used

string Host

SMTP server name or dotted IP address.

string Log

Read-Only. After message sent this property contains log of commands sent to and received from mail server

string MailAgent

Name of program created a message. Default: SoftComplex ASP Email

string Organization

Message author organization

string Password

User password to connect mail server

int Port

SMTP server port. Default 25

int Priority

Email message priority. Allowed values: 1-5 (1 - Highest, 2 - High, 3- Normal, 4 - Low, 5 - Lowest) Default 3

string ReceiptTo

Email address to send a receipt (will be send when user will read received message). e.g: [email protected] or "Jim Smith" <[email protected]>

string Recipients

Email message recipient(s). To specify multiple recipients use coma as separator. e.g.: [email protected], [email protected] or "Jim Smith" <[email protected]>, "John Smith" <[email protected]>

string ReplyTo

Reply to address. The email address to delivery message on reply. e.g: [email protected] or "Jim Smith" <[email protected]>

string Response

Read-Only. The Response property contains error message (if any happened on mail send)

string Sender

Message sender address. e.g: [email protected] or "Jim Smith" <[email protected]>

string Subject

Message subject

int UseEHLO

A greeting type used on SMTP server connect. If 0 HELO command will be used. if 1 EHLO command will be used. Default 1

string Username

Username to connect mail server

string UseTransportLevelSecurity

Transport Level Security used to connect the SMTP server. Allowed values: Implicit, Explicit, Require, No. Default: No

string Version

Component version

Methods:

void AddAttachment(string FilePath)

Adds an attachment to the message

void AddAttachmentEx(string FilePathOrContent, string FileName, string ContentType, string ContentTransferEncoding, string ContentDisposition, string Charset, string ContentLocation, string ContentDescription)

Adds an attachment to the message

void AddBcc(string Name, string Email)

Adds recipient to Bcc list

void AddCc(string Name, string Email)

Adds recipient to Cc list

void AddHeader(string Name, string Value)

Adds a value to message headers

void AddRecipient(string Name, string Email)

Adds recipient to Recipients list

void AddXHeader(string Name, string Value)

Adds a value to message extra headers

void Clear()

Clears all the message

string EmailResolve(string DNSServerAddress, string Email)

Returns MX record value(s) for given email address SMTP server

string GetMessage(int OnlyHeaders)

Returns string represents email message. If OnlyHeaders equals to 1 then returns only headers.

string MXResolve(string DNSServerAddress, string DomainName)

Returns MX record value(s) for domain

int QuickSend(string Host, string From, string ReplyTo, string To, string Subject, string Message)

A shortcut for Send function to send an email message with single line of code

int QuickSendEx(string Host, string Username, string Password, string From, string ReplyTo, string To, string Subject, string Message)

A shortcut for Send function to send an email message with single line of code

int QuickSendHtml(string Host, string From, string ReplyTo, string To, string Subject, string MessageHtml)

A shortcut for Send function to send an email message with single line of code

int QuickSendHtmlEx(string Host, string Username, string Password, string From, string ReplyTo, string To, string Subject, string MessageHtml)

A shortcut for Send function to send an email message with single line of code

void SaveMessage(string FileName, int OnlyHeaders)

Saves message to file. If OnlyHeaders equals to 1 then saves only headers.

int Send()

Sends email message. If message sent successful returns 0. Otherwise check Response property to find error description and Log property to see message sending log

ASP VBasic Demos

Simple Message Send

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = "mail.com"

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"
mailer.Recipients = "[email protected]"

mailer.Username = "[email protected]"

mailer.Password = "pass"

mailer.Subject = "Message Subject"

mailer.Body = "Message Body"

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

Simple HTML Message Send

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = "mail.com"

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"
mailer.Recipients = "[email protected]"

mailer.Username = "[email protected]"
mailer.Password = "pass"

mailer.Subject = "Message Subject"

mailer.BodyHtml = "<html><body><b>Site URL</b>: <a href=""http://softcomplex.com"">softcomplex.com</a></body></html>"

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

Send Message to Multiple Recipients

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = "mail.com"

mailer.From = """Jim Smith"" <[email protected]>"

mailer.ReplyTo = """Jim Smith"" <[email protected]>"
mailer.Recipients = """John Smith"" <[email protected]>, [email protected], rita <[email protected]>"
mailer.Cc = """John Smith"" <[email protected]>, [email protected], rita <[email protected]>"

mailer.Bcc = """John Smith"" <[email protected]>, [email protected], rita <[email protected]>"

mailer.Username = "[email protected]"
mailer.Password = "pass"

mailer.Subject = "Message Subject"

mailer.Body = "Message Body"

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

Send Message with Attachment

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = "mail.com"

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"
mailer.Recipients = "[email protected]"

mailer.Username = "[email protected]"
mailer.Password = "pass"

mailer.Subject = "Message Subject"

mailer.Body = "Message Body"

mailer.AddAttachment "C:\photo.jpg"

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

Send Message with Custom Attachment

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = "mail.com"

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"
mailer.Recipients = "[email protected]"

mailer.Username = "[email protected]"
mailer.Password = "pass"

mailer.Subject = "Message Subject"

mailer.Body = "Message Body"

mailer.AddAttachmentEx "<html><body><font color=""red"">Some message part 1</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "<html><body><font color=""green"">Some message part 2</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "Some message part 3", "", "text/plain", "7bit", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "C:\photo.jpg", "", "image/jpeg", "", "", "", "", ""

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"
else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

GetMessage Method Usage

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.From = """John Smith"" <[email protected]>"
mailer.ReplyTo = """John Smith"" <[email protected]>"

mailer.Recipients = "[email protected]"

mailer.Subject = "Message Subject"
mailer.Body = "Message Body"

mailer.AddAttachmentEx "<html><body><font color=""red"">Some message part 1</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "<html><body><font color=""green"">Some message part 2</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "Some message part 3", "", "text/plain", "7bit", "inline", "us-ascii", "", ""


Response.Write "<p>Message:</p><pre>" & mailer.GetMessage(0) & "</pre>"

set mailer = nothing
        

SaveMessage Method Usage

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"

mailer.Recipients = "[email protected]"

mailer.AddAttachmentEx "<html><body><font color=""red"">Some message part 1</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "<html><body><font color=""green"">Some message part 2</font></body></html>", "", "text/html", "quoted-printable", "inline", "us-ascii", "", ""

mailer.AddAttachmentEx "Some message part 3", "", "text/plain", "7bit", "inline", "us-ascii", "", ""

path = "C:\message.msg"

mailer.SaveMessage path, 0

Response.Write "<p>Message Saved to " & path & "</p>"

set mailer = nothing
        

QuickSendEx Method Usage

set mailer = Server.CreateObject("Softcomplex.Email")

res = mailer.QuickSendEx("mail.com", "[email protected]", "password", "[email protected]", "[email protected]", "[email protected]", "Message Subject", "Message Body")

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

QuickSendHtmlEx Method Usage

set mailer = Server.CreateObject("Softcomplex.Email")

res = mailer.QuickSendEx("mail.com", "[email protected]", "password", "[email protected]", "[email protected]", "[email protected]", _
	"Message Subject", "<html><body><b>Site URL</b>: <a href=""http://softcomplex.com"">softcomplex.com</a></body></html>")

if res = 0 then
  Response.Write "<p> Result: Sent </p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

MX Record Resolve Sample

set mailer = Server.CreateObject("Softcomplex.Email")

mailer.Host = mailer.EmailResolve("192.168.1.1", "[email protected]")

mailer.Host = "mail.com"

mailer.From = """John Smith"" <[email protected]>"

mailer.ReplyTo = """John Smith"" <[email protected]>"
mailer.Recipients = "[email protected]"

mailer.Subject = "Message Subject"

mailer.Body = "Message Body"

res = mailer.Send

if res = 0 then
  Response.Write "<p> Result: Sent (SMTP Host: " & mailer.Host & ")</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

else
  Response.Write "<p> Result: Failed (" &  res & ") </p><p>Reason: " & mailer.Response & "</p><p>Log:</p><pre>" & mailer.Log & "</pre>"

end if	

set mailer = nothing
        

Terms and Conditions

Single Server License

One single server ASP Mail Component license gives the right to use one installation of the component. Component can be used by unlimited number of sites/domains hosted on the server.

Single Organization License

One single organization ASP Mail Component license gives the right to use unlimited installations of the component within single organization network.

Developer License

Developer license gives the right to include unlimited number of ASP Mail Component instances in the products of license owner. Such kind of license is obtained automatically by those who has 5 or more single licenses of any type above.

Discounts

After license order customers are offered special (significantly discounted) prices for other products of SoftComplex.

Usage

As owner of the ASP Mail Component license You are allowed to use the component in any possible way in Internet (public), Intranet (corporate), however You are strictly NOT allowed (unless specifically authorized by SoftComplex.com) to:

Technical Support

You are entitled to free product upgrades and technical support for at least one year from the date of purchase. Technical support includes answers to script related questions via via e-mail and/or Internet instant messaging services.

Violations of Terms and Conditions

Should you violate these Terms and Conditions or any other rights of SoftComplex Inc., SoftComplex Inc. reserves the right to pursue any and all legal and equitable remedies against you without limitation.

Links and References