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.
Set Mail = Server.CreateObject("Persits.MailSender")
Host As String
Port As Integer
From As String
FromName As String
Subject As String
Body As String
AddAddress(Email As String, Optional Name )
AddCC(Email As String, Optional Name )
AddBCC(Email As String, Optional Name )
AddReplyTo(Email As String, Optional Name )
AddAttachment(Path as String)
Send As Boolean
Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = "smtp.yourcompany.com" Mail.From = "BYeltsin@Kremlin.gov.ru" Mail.FromName = "President Boris Yeltsin" Mail.AddAddress "firstname.lastname@example.org", "John Smith, Jr." Mail.AddAddress "email@example.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
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.