AspEmail 3.0 Manual
Create an instance of AspEmail object as follows:
Set Mail = Server.CreateObject("Persits.MailSender")
AspEmail Properties
and Methods
Host As String
-
The internet address of the SMTP server to be used to send email.
-
E.g.
-
Mail.Host = "mail.mycompany.com"
Port As Integer
-
The SMTP server port address. 25 by default.
From As String
-
The email address of the sender.
FromName As String
-
The full name of the sender.
Subject As String
-
The Subject line of the letter.
Body As String
-
The body of the letter.
IsHTML As Boolean
-
False by default. If set to True, AspEmail will set the CONTENT-TYPE of the message body to TEXT/HTML.
AddAddress(Email As String, Optional Name )
-
Adds an email address and optionally the corresponding full name to the
letter's TO list.
AddCC(Email As String, Optional Name )
-
Adds an email address and optionally the corresponding full name to the
letter's CC list.
AddBCC(Email As String, Optional Name )
-
Adds an email address and optionally the corresponding full name to the
letter's BCC list.
AddReplyTo(Email As String, Optional Name )
-
Adds an email address and optionally the corresponding full name to the
letter's REPLY-TO list.
AddAttachment(Path as String)
-
Adds a file path to the list of attachments to be sent with the letter.
Send As Boolean
-
Sends the letter. Throws exceptions in case of errors.
Reset
Empties all the address lists so that a new letter could be sent.
Code Snipet
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.yourcompany.com"
Mail.From = "BYeltsin@Kremlin.gov.ru"
Mail.FromName = "President Boris Yeltsin"
Mail.AddAddress "jsmith@company.net", "John Smith, Jr."
Mail.AddAddress "paul@company.com", "Paul L.Johnson, Esq."
Mail.AddReplyTo "receptions@Kremlin.gov.ru"
Mail.Subject = "Black Tie Reception in Kremlin On May Day"
Mail.Body = "Dear Sir:" + Chr(13) + Chr(10) + "Please be at the Kremlin on May 1."
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Letter was not sent due to the following error: " & Err.Description
End If