AspEmail 2.0 Manual

Copyright (c) 1998 Persits Software, Inc.


Register AspEmail by executing the following command at MS DOS or Start/Run prompt:


AspEmail is shipped with a trial version of the AspUpload component from Persits Software, which can be used to upload file attachments to the server as discussed below. Register AspUpload by executing the following command:


AspUpload is not needed to run AspEmail. However, the sample ASP application shipped with AspEmail makes use of it to demonstrate the attachment functionality of AspEmail, so it is a good idea to register it too, unless it has already been registered on your system.



Create an instance of AspEmail object as follows:
 

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.
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

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

Sample ASP Application

AspEmail is shipped with a sample ASP application that allows you to create and send email messages with attachments over the Web. The application consists of the following files:

global.asa (collection object creation)
SendMail.asp (main Email interface page)
Attachments.asp (attachment handling page)
UploadScript.asp (upload script which uses AspUpload).

To upload file attachments from a client machine to the server where the script is running, the application uses a trial version of AspUpload, a powerful file upload component from Persits Software. The file AspUpload.dll is shipped with AspEmail and must be registered on your system for the sample application to function. For complete documentation on the AspUpload component, or to purchase AspUpload, go to http://www.AspUpload.com.