A guide to all of the methods that ASPMail provides on our NT Servers.
SendMail
The SendMail method attempts to send the email. SendMail takes no parameters, you build the message using the FromAddress, Subject, BodyText, and RemoteHost properties along with the AddRecipient method.
Returns: True / False
Example:
if Mailer.SendMail then ' Message sent Successfully else Response.Write ("Mail Failure: " & Mailer.Response) end if
AddRecipient (name, address)
Adds a new recipient, as shown in the message's To list. 'Name' may be left blank.
Returns: True / False
Example:
returnValue = Mailer.AddRecipient("Jay Jones","jayj@somehost.net") if returnValue then ' jay jones added successfully end if
ClearRecipients
Clears any recipients assigned to the To list.
Returns: Nothing
AddCC (name, address)
Adds a new recipient, as shown in the message's CC list. The 'name' parameter may be left blank.
Returns: True / False
Example:
returnValue = Mailer.AddCC ("", "jayj@somehost.net") if returnValue then ' jayj added successfully end if
ClearCCs
Clears any recipients assigned to the CC list.
Returns: Nothing
AddBCC (name, address)
Adds a new Blind Carbon Copy recipient. BCC recipients are not shown in any message recipient list.
Returns: True / False
Example:
returnValue = Mailer.AddBCC ("Jay Jones", "jayj@somehost.net") if returnValue then ' Jay Jones added to BCC list end if
ClearBCCs
Clears any recipients assigned to the BCC list.
Returns: Nothing
ClearAllRecipients
Clears all recipients assigned to the To, CC and BCC lists.
Returns: Nothing
AddAttachment (filePath)
Adds attachments to current mailing. You must use a fully qualified path to attach files.
Returns: Nothing
Examples:
Mailer.AddAttachment ("D:\webs\mysite\downloads\myfile.zip") Mailer.AddAttachment (Server.Mappath("/downloads/myFile.zip"))
ClearAttachments
Clears any attachments that were previously set.
Returns: Nothing
ClearBodyText
Clears any text assigned to the message's body which may have been set previously by using the BodyText property.
Returns: Nothing
AddExtraHeader (header)
Adds extra X-Headers to the mail envelope. 'Header' is a string value that forms a proper SMTP X-Header.
Returns: True / False
Example:
returnValue = Mailer.AddExtraHeader("X-HeaderName: XHdrValue")
ClearExtraHeaders
Clears any X-Headers that were set by use of AddExtraHeader.
GetBodyTextFromFile (filePath)
Loads message's body text from a file. filePath must be a fully qualified path.
Examples:
Mailer.GetBodyTextFromFile ("d:\webs\mysite\data\msgbody.txt") Mailer.GetBodyTextFromFile (Server.MapPath("/data/msgbody.txt")
EncodeHeader (strValue)
Encodes a string in RFC1522 format to provide support for 8bit mail headers such as 8bit subject headers. 'strValue' is the string to encode.
Returns: Encoded string
Example:
Mailer.Subject = Mailer.EncodeHeader("Résponse de Service à la clientèle")
GetTempPath
Returns the path set up by the OS for temporary mail files.
Returns: Path string
Example:
tempPath = Mailer.GetTempPath
Please note: the information on this page applies to ITS web hosting plans. It may or may not apply to other environments. If you are looking for a feature described here, or better support from your hosting provider, please consider hosting your site with ITS!
Copyright © 1996-2024, Integrated Technical Solutions, Inc., all rights reserved. See Terms/Legal for trademarks, copyright, and terms of use.
Naperville, IL 60563
fax 630.420.2771