International Sites:





/ PORTUNITY.INFO /


PMail

Provides a class for sending HTML and text e-mails with attachments.

Fields:
To, String
CC, String
BCC, Integer
Subject, String
From, String
ReplyTo, String
Priority, String
Body, String
CharSet, String

function PMail ($sTo="",$sSubject="",$sMessage="",$sFrom="") [CONSTRUCTOR]
The constructor defines several internal variables to reasonable default values. Optional the recipient address, the subject, the message and the sender can already be passed along with the values to the constructor in order to save separate function calls.

function AddAttachment($bData,$sName="",$sContentType="application/octet-stream")
Adds the binary content passed in the parameter $bData as attachment to the mail. Optional the name can be defined with $sName for the attachment as well as the MIME type of the attachment with $sContentType. $sContentType can contain both a MIME type and a file extension. The most common file extensions like ,e. g., .jpg, .html, .txt, .pdf etc. are converted into a MIME type automatically.

function AddAttachmentFile($sFile="")
The function reads in the passed file $sFile and calls the object function AddAttachment internally in order to save the read-in content internally as file attachment for forwarding.

function Field ($sFieldName)
Reads out the passed field $sFieldName and returns the field content.

function Send ()
If the object is valid (object function Valid) Send puts the e-mail together with the attachments and sends them to the saved recipients.

function SetCharset ($sCharset="iso-8859-1")
Defines the character set of the e-mail.

function Valid ()
Checks if all necessary data (recipient, subject, mail text) for sending an e-mail are existent (=1) or not (=0).

function WriteField($sFieldName,$sFieldValue )
Writes the passed content of the variable $sFieldValue into the field which is defined through the parameter $sFieldName.

The value for the field "To" can contain several recipient addresses, which have to be passed separated by commas. Furthermore several recipient addresses can be saved as well through multiple calling of the WriteField function for this field.

The following constants are available for the field priority:
- PS_MailPriority_Normal
- PS_MailPriority_Low
- PS_MailPriority_VeryLow
- PS_MailPriority_High
- PS_MailPriority_VeryHigh

For the field "Body" the function recognizes automatically if it is about a HTML-coded message or not.


Continue to recommend this article:

Your Name:

Your eMail-Adress:

eMail of Recipient:

Additional text:







Direct links to the new Portalsuite 2002:

- Productinfos
- Download

- Support overview
- Support forum