## Class phpmailer

    phpmailer

### Classes extended from phpmailer:

Located in File: Program_Root/class.phpmailer.php

phpmailer - PHP email transport class

- Package - `default`
- Author - `Brent R. Matzelle`

Class Variable Summary

`$AltBody`

> Sets the text-only body of the message. This automatically sets the

> Default Value: `-><-`

`$Body`

> Sets the Body of the message. This can be either an HTML or text body.

> Default Value: `-><-`

`$CharSet`

> Sets the CharSet of the message.

> Default Value: `->iso-8859-1<-`

`$ConfirmReadingTo`

> Sets the email address that a reading confirmation will be sent.

> Default Value: `-><-`

`$ContentType`

> Sets the Content-type of the message.

> Default Value: `->text/plain<-`

`$CustomHeader`

> Holds all custom headers.

> Default Value: `->array()<-`

`$Encoding`

> Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".

> Default Value: `->8bit<-`

`$ErrorInfo`

> Holds the most recent mailer error message.

> Default Value: `-><-`

`$From`

> Sets the From email address for the message.

> Default Value: `->root@localhost<-`

`$FromName`

> Sets the From name of the message.

> Default Value: `->Root User<-`

`$Helo`

> Sets the SMTP HELO of the message.

> Default Value: `->localhost.localdomain<-`

`$Host`

> Sets the SMTP hosts. All hosts must be separated by a

> Default Value: `->localhost<-`

`$LE`

> Sets the line endings of the message.

> Default Value: `->\n<-`

`$Mailer`

> Method to send mail: ("mail", "sendmail", or "smtp").

> Default Value: `->mail<-`

`$message_type`

> Holds the type of the message.

> Default Value: `-><-`

`$Password`

> Sets SMTP password.

> Default Value: `-><-`

`$PluginDir`

> Path to phpmailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.

> Default Value: `-><-`

`$Port`

> Sets the default SMTP server port.

> Default Value: `->25<-`

`$Priority`

> Email priority (1 = High, 3 = Normal, 5 = low).

> Default Value: `->3<-`

`$ReplyTo`

> Holds all "Reply-To" addresses.

> Default Value: `->array()<-`

`$Sender`

> Sets the Sender email of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

> Default Value: `-><-`

`$Sendmail`

> Sets the path of the sendmail program.

> Default Value: `->/usr/sbin/sendmail<-`

`$SMTPAuth`

> Sets SMTP authentication. Utilizes the Username and Password variables.

> Default Value: `->false<-`

`$SMTPDebug`

> Sets SMTP class debugging on or off.

> Default Value: `->false<-`

`$Subject`

> Sets the Subject of the message.

> Default Value: `-><-`

`$Timeout`

> Sets the SMTP server timeout in seconds. This function will not work with the win32 version.

> Default Value: `->10<-`

`$UseMSMailHeaders`

> Turns Microsoft mail client headers on and off. Useful mostly for older clients.

> Default Value: `->false<-`

`$Username`

> Sets SMTP username.

> Default Value: `-><-`

`$Version`

> Holds phpmailer version.

> Default Value: `->1.54<-`

`$WordWrap`

> Sets word wrapping on the body of the message to a given number of characters.

> Default Value: `->0<-`

Inherited Class Variable Summary

Inherited Method Summary

Method Summary

`void AddAddress ( $address, [$name = ""] )`

> Adds a "To" address. Returns void.

`bool AddAttachment ( $path, [$name = ""], [$encoding = "base64"], [$type = "application/octet-stream"] )`

> Adds an attachment from a path on the filesystem.

`void AddBCC ( $address, [$name = ""] )`

> Adds a "Bcc" address. Note: this function works

`void AddCC ( $address, [$name = ""] )`

> Adds a "Cc" address. Note: this function works

`void AddCustomHeader ( $custom_header )`

> Adds a custom header. Returns void.

`bool AddEmbeddedImage ( $path, $cid, [$name = ""], [$encoding = "base64"], [$type = "application/octet-stream"] )`

> Adds an embedded attachment. This can include images, sounds, and just about any other document.

`void AddReplyTo ( $address, [$name = ""] )`

> Adds a "Reply-to" address. Returns void.

`void AddStringAttachment ( $string, $filename, [$encoding = "base64"], [$type = "application/octet-stream"] )`

> Adds a string or binary attachment (non-filesystem) to the list.

`void ClearAddresses ( )`

> Clears all recipients assigned in the TO array. Returns void.

`void ClearAllRecipients ( )`

> Clears all recipients assigned in the TO, CC and BCC array. Returns void.

`void ClearAttachments ( )`

> Clears all previously set filesystem, string, and binary attachments. Returns void.

`void ClearBCCs ( )`

> Clears all recipients assigned in the BCC array. Returns void.

`void ClearCCs ( )`

> Clears all recipients assigned in the CC array. Returns void.

`void ClearCustomHeaders ( )`

> Clears all custom headers. Returns void.

`void ClearReplyTos ( )`

> Clears all recipients assigned in the ReplyTo array. Returns void.

`void IsHTML ( $bool )`

> Sets message type to HTML. Returns void.

`void IsMail ( )`

> Sets Mailer to send message using PHP mail() function.

`void IsQmail ( )`

> Sets Mailer to send message using the qmail MTA. Returns void.

`void IsSendmail ( )`

> Sets Mailer to send message using the $Sendmail program.

`void IsSMTP ( )`

> Sets Mailer to send message using SMTP.

`bool Send ( )`

> Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error. Returns bool.

`string SendToQueue ( $queue_path, $send_time )`

> Sends mail message to an assigned queue directory. Has an optional sendTime argument. This is used when the user wants the message to be sent from the queue at a predetermined time.

<hbr>

Variable Detail

### $AltBody

Data type: string
Sets the text-only body of the message. This automatically sets the

    email to multipart/alternative.  This body can be read by mail
     clients that do not have HTML email capability such as mutt. Clients
     that can read HTML will view the normal Body.

- Access - `public`

### $Body

Data type: string
Sets the Body of the message. This can be either an HTML or text body.

    If HTML then run IsHTML(true).

- Access - `public`

### $CharSet

Data type: string
Sets the CharSet of the message.

- Access - `public`

### $ConfirmReadingTo

Data type: string
Sets the email address that a reading confirmation will be sent.

- Access - `public`

### $ContentType

Data type: string
Sets the Content-type of the message.

- Access - `public`

### $CustomHeader

Data type: array
Holds all custom headers.

### $Encoding

Data type: string
Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".

- Access - `public`

### $ErrorInfo

Data type: string
Holds the most recent mailer error message.

- Access - `public`

### $From

Data type: string
Sets the From email address for the message.

- Access - `public`

### $FromName

Data type: string
Sets the From name of the message.

- Access - `public`

### $Helo

Data type: string
Sets the SMTP HELO of the message.

- Access - `public`

### $Host

Data type: string
Sets the SMTP hosts. All hosts must be separated by a

    semicolon.  You can also specify a different port
      for each host by using this format: [hostname:port]
      (e.g. "smtp1.domain.com:25;smtp2.domain.com").
      Hosts will be tried in order.

- Access - `public`

### $LE

Data type: string
Sets the line endings of the message.

- Access - `public`

### $Mailer

Data type: string
Method to send mail: ("mail", "sendmail", or "smtp").

- Access - `public`

### $message_type

Data type: string
Holds the type of the message.

### $Password

Data type: string
Sets SMTP password.

- Access - `public`

### $PluginDir

Data type: string
Path to phpmailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.

- Access - `public`

### $Port

Data type: int
Sets the default SMTP server port.

- Access - `public`

### $Priority

Data type: int
Email priority (1 = High, 3 = Normal, 5 = low).

- Access - `public`

### $ReplyTo

Data type: array
Holds all "Reply-To" addresses.

### $Sender

Data type: string
Sets the Sender email of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

- Access - `public`

### $Sendmail

Data type: string
Sets the path of the sendmail program.

- Access - `public`

### $SMTPAuth

Data type: bool
Sets SMTP authentication. Utilizes the Username and Password variables.

- Access - `public`

### $SMTPDebug

Data type: bool
Sets SMTP class debugging on or off.

- Access - `public`

### $Subject

Data type: string
Sets the Subject of the message.

- Access - `public`

### $Timeout

Data type: int
Sets the SMTP server timeout in seconds. This function will not work with the win32 version.

- Access - `public`

### $UseMSMailHeaders

Data type: bool
Turns Microsoft mail client headers on and off. Useful mostly for older clients.

- Access - `public`

### $Username

Data type: string
Sets SMTP username.

- Access - `public`

### $Version

Data type: string
Holds phpmailer version.

- Access - `public`

### $WordWrap

Data type: int
Sets word wrapping on the body of the message to a given number of characters.

- Access - `public`

Method Detail

### AddAddress

void AddAddress ( $address, [$name = ""] )

Adds a "To" address. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### AddAttachment

bool AddAttachment ( $path, [$name = ""], [$encoding = "base64"], [$type = "application/octet-stream"] )

Adds an attachment from a path on the filesystem.

    Checks if attachment is valid and then adds
     the attachment to the list.
     Returns false if the file could not be found
     or accessed.

Function Parameters:
Function Info:
  Access - `public`

### AddBCC

void AddBCC ( $address, [$name = ""] )

Adds a "Bcc" address. Note: this function works

    with the SMTP mailer on win32, not with the "mail"
     mailer.  This is a PHP bug that has been submitted
     on http://bugs.php.net. The *NIX version of PHP
     functions correctly.
     Returns void.

Function Parameters:
Function Info:
  Access - `public`

### AddCC

void AddCC ( $address, [$name = ""] )

Adds a "Cc" address. Note: this function works

    with the SMTP mailer on win32, not with the "mail"
     mailer.  This is a PHP bug that has been submitted
     on http://bugs.php.net. The *NIX version of PHP
     functions correctly. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### AddCustomHeader

void AddCustomHeader ( $custom_header )

Adds a custom header. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### AddEmbeddedImage

bool AddEmbeddedImage ( $path, $cid, [$name = ""], [$encoding = "base64"], [$type = "application/octet-stream"] )

Adds an embedded attachment. This can include images, sounds, and just about any other document.

Function Parameters:
  - `$path cid this is the Content Id of the attachment. Use this to identify the Id for accessing the image in an HTML form.`
Function Info:
  Access - `public`

### AddReplyTo

void AddReplyTo ( $address, [$name = ""] )

Adds a "Reply-to" address. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### AddStringAttachment

void AddStringAttachment ( $string, $filename, [$encoding = "base64"], [$type = "application/octet-stream"] )

Adds a string or binary attachment (non-filesystem) to the list.

    This method can be used to attach ascii or binary data,
     such as a BLOB record from a database.

Function Parameters:
Function Info:
  Access - `public`

### ClearAddresses

void ClearAddresses ( )

Clears all recipients assigned in the TO array. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearAllRecipients

void ClearAllRecipients ( )

Clears all recipients assigned in the TO, CC and BCC array. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearAttachments

void ClearAttachments ( )

Clears all previously set filesystem, string, and binary attachments. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearBCCs

void ClearBCCs ( )

Clears all recipients assigned in the BCC array. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearCCs

void ClearCCs ( )

Clears all recipients assigned in the CC array. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearCustomHeaders

void ClearCustomHeaders ( )

Clears all custom headers. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### ClearReplyTos

void ClearReplyTos ( )

Clears all recipients assigned in the ReplyTo array. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### IsHTML

void IsHTML ( $bool )

Sets message type to HTML. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### IsMail

void IsMail ( )

Sets Mailer to send message using PHP mail() function.

    Returns void.

Function Parameters:
Function Info:
  Access - `public`

### IsQmail

void IsQmail ( )

Sets Mailer to send message using the qmail MTA. Returns void.

Function Parameters:
Function Info:
  Access - `public`

### IsSendmail

void IsSendmail ( )

Sets Mailer to send message using the $Sendmail program.

    Returns void.

Function Parameters:
Function Info:
  Access - `public`

### IsSMTP

void IsSMTP ( )

Sets Mailer to send message using SMTP.

    Returns void.

Function Parameters:
Function Info:
  Access - `public`

### Send

bool Send ( )

Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error. Returns bool.

Function Parameters:
Function Info:
  Access - `public`

### SendToQueue

string SendToQueue ( $queue_path, $send_time )

Sends mail message to an assigned queue directory. Has an optional sendTime argument. This is used when the user wants the message to be sent from the queue at a predetermined time.

    The data must be a valid timestamp like that returned from
     the time() or strtotime() functions.  Returns false on failure
     or the message file name if success.

Function Parameters:
Function Info:
  Access - `public`