CWIS Developer Documentation
Public Member Functions | List of all members
Email Class Reference

Electronic mail message. More...

Public Member Functions

 __construct ()
 Object constructor.
 

Sending

 Send ()
 Mail the message.
 

Message Attributes

 Body ($NewValue=NULL)
 Get/set message body.
 
 Subject ($NewValue=NULL)
 Get/set message subject.
 
 From ($NewAddress=NULL, $NewName=NULL)
 Get/set message sender.
 
 ReplyTo ($NewAddress=NULL, $NewName=NULL)
 Get/set message "Reply-To" address.
 
 To ($NewValue=NULL)
 Get/set message recipient(s).
 
 CC ($NewValue=NULL)
 Get/set message CC list.
 
 BCC ($NewValue=NULL)
 Get/set message BCC list.
 
 AddHeaders ($NewHeaders)
 Specify additional message headers to be included.
 

Mail Delivery Method

const METHOD_PHPMAIL = 1
 
const METHOD_SMTP = 2
 
static DeliveryMethod ($NewValue=NULL)
 Get/set mail delivery method.
 
static Server ($NewValue=NULL)
 Get/set server for mail delivery.
 
static Port ($NewValue=NULL)
 Get/set port number for mail delivery.
 
static UserName ($NewValue=NULL)
 Get/set user name for mail delivery.
 
static Password ($NewValue=NULL)
 Get/set password for mail delivery.
 
static UseAuthentication ($NewValue=NULL)
 Get/set whether to use authentication for mail delivery.
 
static DeliverySettings ($NewSettings=NULL)
 Get/set serialized (opaque text) version of delivery settings.
 
static DeliverySettingsOkay ()
 Test delivery settings and report their validity.
 
static DeliverySettingErrors ()
 Return array with list of delivery setting errors (if any).
 

Detailed Description

Electronic mail message.

Definition at line 15 of file Email.php.

Constructor & Destructor Documentation

Email::__construct ( )

Object constructor.

Definition at line 22 of file Email.php.

Member Function Documentation

Email::AddHeaders (   $NewHeaders)

Specify additional message headers to be included.

Parameters
NewHeadersArray of header lines.

Definition at line 199 of file Email.php.

Email::BCC (   $NewValue = NULL)

Get/set message BCC list.

Parameters
NewValueNew message BCC recipient or array of BCC recipients, in RFC-2822 format ("user@example.com" or "User <user@example.com>" if name included). (OPTIONAL)
Returns
Array of current message BCC recipient(s) in RFC-2822 format.

Definition at line 179 of file Email.php.

Email::Body (   $NewValue = NULL)

Get/set message body.

Parameters
NewValueNew message body. (OPTIONAL)
Returns
Current message body.

Definition at line 57 of file Email.php.

Email::CC (   $NewValue = NULL)

Get/set message CC list.

Parameters
NewValueNew message CC recipient or array of CC recipients, in RFC-2822 format ("user@example.com" or "User <user@example.com>" if name included). (OPTIONAL)
Returns
Array of current message CC recipient(s) in RFC-2822 format.

Definition at line 156 of file Email.php.

static Email::DeliveryMethod (   $NewValue = NULL)
static

Get/set mail delivery method.

If specified, the method must be one of the predefined "METHOD_" constants.

Parameters
NewValueNew delivery method. (OPTIONAL)
Returns
Current delivery method.

Definition at line 214 of file Email.php.

static Email::DeliverySettingErrors ( )
static

Return array with list of delivery setting errors (if any).

Returns
Array with settings that are possibly bad.

Definition at line 391 of file Email.php.

static Email::DeliverySettings (   $NewSettings = NULL)
static

Get/set serialized (opaque text) version of delivery settings.

This method is intended to be used to store and retrieve all email delivery settings for the class, in a form suitable to be saved to a database.

Parameters
NewSettingsNew delivery settings values.
Returns
Current delivery settings values.

Definition at line 287 of file Email.php.

static Email::DeliverySettingsOkay ( )
static

Test delivery settings and report their validity.

For example, if the deliver method is set to SMTP it would test the server, port, and (if authentication is indicated) user name and password. If delivery settings are not okay, then DeliverySettingErrors() can be used to determine (if known) which settings may have problems.

Returns
TRUE if delivery settings are okay, otherwise FALSE.

Definition at line 319 of file Email.php.

Email::From (   $NewAddress = NULL,
  $NewName = NULL 
)

Get/set message sender.

Parameters
NewAddressNew message sender address. (OPTIONAL, but required if NewName is specified.)
NewNameNew message sender name. (OPTIONAL)
Returns
Current message sender in RFC-2822 format ("user@example.com" or "User <user@example.com>" if name available).

Definition at line 82 of file Email.php.

static Email::Password (   $NewValue = NULL)
static

Get/set password for mail delivery.

Parameters
NewValueNew password. (OPTIONAL)
Returns
Current password.

Definition at line 263 of file Email.php.

static Email::Port (   $NewValue = NULL)
static

Get/set port number for mail delivery.

Parameters
NewValueNew port number. (OPTIONAL)
Returns
Current port number.

Definition at line 241 of file Email.php.

Email::ReplyTo (   $NewAddress = NULL,
  $NewName = NULL 
)

Get/set message "Reply-To" address.

Parameters
NewAddressNew message "Reply-To" address. (OPTIONAL, but required if NewName is specified.)
NewNameNew message "Reply-To" name. (OPTIONAL)
Returns
Current message "Reply-To" address in RFC-2822 format ("user@example.com" or "User <user@example.com>" if name available).

Definition at line 108 of file Email.php.

Email::Send ( )

Mail the message.

Returns
TRUE if message was successfully accepted for delivery, otherwise FALSE.

Definition at line 34 of file Email.php.

static Email::Server (   $NewValue = NULL)
static

Get/set server for mail delivery.

Parameters
NewValueNew server. (OPTIONAL)
Returns
Current server.

Definition at line 230 of file Email.php.

Email::Subject (   $NewValue = NULL)

Get/set message subject.

Parameters
NewValueNew message subject. (OPTIONAL)
Returns
Current message subject.

Definition at line 68 of file Email.php.

Email::To (   $NewValue = NULL)

Get/set message recipient(s).

Parameters
NewValueNew message recipient or array of recipients, in RFC-2822 format ("user@example.com" or "User <user@example.com>" if name included). (OPTIONAL)
Returns
Array of current message recipient(s) in RFC-2822 format.

Definition at line 133 of file Email.php.

static Email::UseAuthentication (   $NewValue = NULL)
static

Get/set whether to use authentication for mail delivery.

Parameters
NewValueNew authentication setting. (OPTIONAL)
Returns
Current authentication setting.

Definition at line 274 of file Email.php.

static Email::UserName (   $NewValue = NULL)
static

Get/set user name for mail delivery.

Parameters
NewValueNew user name. (OPTIONAL)
Returns
Current user name.

Definition at line 252 of file Email.php.

Member Data Documentation

const Email::METHOD_PHPMAIL = 1

Definition at line 222 of file Email.php.

const Email::METHOD_SMTP = 2

Definition at line 223 of file Email.php.


The documentation for this class was generated from the following file: