Class phpmailer

phpmailer

Classes extended from phpmailer:

Located in File: Program_Root/class.phpmailer.php


phpmailer - PHP email transport class


Class Variable Summary
$AltBody
Sets the text-only body of the message.
Default Value: -><-
$Body
Sets the Body of the message.
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.
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 is $Hostname).
Default Value: -><-
$Host
Sets the SMTP hosts.
Default Value: ->localhost<-
$Hostname
Sets the hostname to use in Message-Id and Received headers and as default HELO string.
Default Value: -><-
$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.
Default Value: -><-
$Sendmail
Sets the path of the sendmail program.
Default Value: ->/usr/sbin/sendmail<-
$SMTPAuth
Sets SMTP authentication.
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.
Default Value: ->10<-
$UseMSMailHeaders
Turns Microsoft mail client headers on and off.
Default Value: ->false<-
$Username
Sets SMTP username.
Default Value: -><-
$Version
Holds phpmailer version.
Default Value: ->1.65<-
$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.
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.
void AddCC ( $address, $name )
Adds a "Cc" address.
void AddCustomHeader ( $custom_header )
Adds a custom header.
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.
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.
void ClearAllRecipients ( )
Clears all recipients assigned in the TO, CC and BCC array.
void ClearAttachments ( )
Clears all previously set filesystem, string, and binary attachments.
void ClearBCCs ( )
Clears all recipients assigned in the BCC array.
void ClearCCs ( )
Clears all recipients assigned in the CC array.
void ClearCustomHeaders ( )
Clears all custom headers.
void ClearReplyTos ( )
Clears all recipients assigned in the ReplyTo array.
void IsHTML ( $bool )
Sets message type to HTML.
void IsMail ( )
Sets Mailer to send message using PHP mail() function. Returns void.
void IsQmail ( )
Sets Mailer to send message using the qmail MTA.
void IsSendmail ( )
Sets Mailer to send message using the $Sendmail program. Returns void.
void IsSMTP ( )
Sets Mailer to send message using SMTP. Returns void.
bool Send ( )
Creates message and assigns Mailer.
string SendToQueue ( $queue_path, [$send_time = 0] )
Sends mail message to an assigned queue directory.
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.

$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).

$CharSet

Data type: string
Sets the CharSet of the message.


$ConfirmReadingTo

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


$ContentType

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


$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".

$ErrorInfo

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


$From

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


$FromName

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


$Helo

Data type: string
Sets the SMTP HELO of the message (Default is $Hostname).


$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.example.com:25;smtp2.example.com").
 Hosts will be tried in order.

$Hostname

Data type: string
Sets the hostname to use in Message-Id and Received headers and as default HELO string.
If empty, the value returned
 by SERVER_NAME is used or 'localhost.localdomain'.

$LE

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


$Mailer

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


$message_type

Data type: string
Holds the type of the message.


$Password

Data type: string
Sets SMTP password.


$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.


$Port

Data type: int
Sets the default SMTP server port.


$Priority

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


$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.

$Sendmail

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


$SMTPAuth

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

$SMTPDebug

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


$Subject

Data type: string
Sets the Subject of the message.


$Timeout

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

$UseMSMailHeaders

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

$Username

Data type: string
Sets SMTP username.


$Version

Data type: string
Holds phpmailer version.


$WordWrap

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



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:
- cid $path: 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 = 0] )

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