Child classes:
Inherited Variables
Inherited Constants
Inherited Methods
Class Details
phpmailer - PHP email transport class
Tags:
- author - Brent R. Matzelle
[ Top ]
Class Variables
$AltBody = ""
[line 108]
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.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$attachment = array()
[line 281]
Holds all string and binary attachments.
Tags:
- access - private
Type: array
Overrides:
[ Top ]
$bcc = array()
[line 268]
Holds all "BCC" addresses.
Tags:
- access - private
Type: array
Overrides:
[ Top ]
$Body = ""
[line 98]
Sets the Body of the message. This can be either an HTML or text body.
If HTML then run IsHTML(true).
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$boundary = array()
[line 300]
Holds the message boundaries.
Tags:
- var - array
- access - private
Type: string
Overrides:
[ Top ]
$cc = array()
[line 261]
Holds all "CC" addresses.
Tags:
- access - private
Type: array
Overrides:
[ Top ]
$CharSet = "iso-8859-1"
[line 39]
Sets the CharSet of the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$ConfirmReadingTo = ""
[line 160]
Sets the email address that a reading confirmation will be sent.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$ContentType = "text/plain"
[line 46]
Sets the Content-type of the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$CustomHeader = array()
[line 287]
Holds all custom headers.
Type: array
Overrides:
[ Top ]
$Encoding = "8bit"
[line 54]
Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$ErrorInfo = ""
[line 61]
Holds the most recent mailer error message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$From = "root@localhost"
[line 68]
Sets the From email address for the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$FromName = "Root User"
[line 75]
Sets the From name of the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Helo = ""
[line 206]
Sets the SMTP HELO of the message (Default is $Hostname).
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Host = "localhost"
[line 192]
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.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Hostname = ""
[line 176]
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'.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$LE = "\n"
[line 167]
Sets the line endings of the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Mailer = "mail"
[line 123]
Method to send mail: ("mail", "sendmail", or "smtp").
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$message_type = ""
[line 293]
Holds the type of the message.
Type: string
Overrides:
[ Top ]
$Password = ""
[line 227]
Sets SMTP password.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$PluginDir = ""
[line 146]
Path to phpmailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Port = 25
[line 199]
Sets the default SMTP server port.
Tags:
- access - public
Type: int
Overrides:
[ Top ]
$Priority = 3
[line 32]
Email priority (1 = High, 3 = Normal, 5 = low).
Tags:
- access - public
Type: int
Overrides:
[ Top ]
$ReplyTo = array()
[line 274]
Holds all "Reply-To" addresses.
Type: array
Overrides:
[ Top ]
$Sender = ""
[line 83]
Sets the Sender email of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Sendmail = "/usr/sbin/sendmail"
[line 130]
Sets the path of the sendmail program.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$SMTPAuth = false
[line 213]
Sets SMTP authentication. Utilizes the Username and Password variables.
Tags:
- access - public
Type: bool
Overrides:
[ Top ]
$SMTPDebug = false
[line 242]
Sets SMTP class debugging on or off.
Tags:
- access - public
Type: bool
Overrides:
[ Top ]
$Subject = ""
[line 90]
Sets the Subject of the message.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Timeout = 10
[line 235]
Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
Tags:
- access - public
Type: int
Overrides:
[ Top ]
$to = array()
[line 254]
Holds all "To" addresses.
Tags:
- access - private
Type: array
Overrides:
[ Top ]
$UseMSMailHeaders = false
[line 138]
Turns Microsoft mail client headers on and off. Useful mostly for older clients.
Tags:
- access - public
Type: bool
Overrides:
[ Top ]
$Username = ""
[line 220]
Sets SMTP username.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$Version = "1.65"
[line 153]
Holds phpmailer version.
Tags:
- access - public
Type: string
Overrides:
[ Top ]
$WordWrap = 0
[line 116]
Sets word wrapping on the body of the message to a given number of characters.
Tags:
- access - public
Type: int
Overrides:
[ Top ]
Class Methods
AddAddress
void AddAddress(
$address, [
$name = ""])
[line 369]
Adds a "To" address. Returns void.
Tags:
- access - public
Parameters:
- $address -
- $name -
[ Top ]
AddAttachment
bool AddAttachment(
$path, [
$name = ""], [
$encoding = "base64"], [
$type = "application/octet-stream"])
[line 1155]
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.
Tags:
- access - public
Parameters:
- $path -
- $name -
- $encoding -
- $type -
[ Top ]
AddBCC
void AddBCC(
$address, [
$name = ""])
[line 400]
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.
Tags:
- access - public
Parameters:
- $address -
- $name -
[ Top ]
AddCC
void AddCC(
$address, [
$name = ""])
[line 384]
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.
Tags:
- access - public
Parameters:
- $address -
- $name -
[ Top ]
AddCustomHeader
void AddCustomHeader(
$custom_header)
[line 1664]
Adds a custom header. Returns void.
Tags:
- access - public
Parameters:
- $custom_header -
[ Top ]
AddEmbeddedImage
bool AddEmbeddedImage(
cid
$path,
$cid, [
$name = ""], [
$encoding = "base64"], [
$type = "application/octet-stream"])
[line 1429]
Adds an embedded attachment. This can include images, sounds, and just about any other document.
Tags:
- access - public
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.
- $cid -
- $name -
- $encoding -
- $type -
[ Top ]
AddMSMailHeaders
string AddMSMailHeaders(
)
[line 1674]
Adds all the Microsoft message headers. Returns string.
Tags:
- access - private
Parameters:
[ Top ]
AddReplyTo
void AddReplyTo(
$address, [
$name = ""])
[line 411]
Adds a "Reply-to" address. Returns void.
Tags:
- access - public
Parameters:
- $address -
- $name -
[ Top ]
addr_append
string addr_append(
$type,
$addr)
[line 784]
Creates recipient headers. Returns string.
Tags:
- access - private
Parameters:
- $type -
- $addr -
[ Top ]
addr_format
string addr_format(
$addr)
[line 823]
Formats an address correctly.
Tags:
- access - private
Parameters:
- $addr -
[ Top ]
addr_list
string addr_list(
$list_array)
[line 806]
Creates a semicolon delimited list for use in pqm files.
Tags:
- access - private
Parameters:
- $list_array -
[ Top ]
AddStringAttachment
void AddStringAttachment(
$string,
$filename, [
$encoding = "base64"], [
$type = "application/octet-stream"])
[line 1408]
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.
Tags:
- access - public
Parameters:
- $string -
- $filename -
- $encoding -
- $type -
[ Top ]
attach_all
string attach_all(
)
[line 1186]
Attaches all fs, string, and binary attachments to the message.
Returns a string if successful or false if unsuccessful.
Tags:
- access - private
Parameters:
[ Top ]
ClearAddresses
void ClearAddresses(
)
[line 1480]
Clears all recipients assigned in the TO array. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearAllRecipients
void ClearAllRecipients(
)
[line 1517]
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearAttachments
void ClearAttachments(
)
[line 1529]
Clears all previously set filesystem, string, and binary attachments. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearBCCs
void ClearBCCs(
)
[line 1498]
Clears all recipients assigned in the BCC array. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearCCs
void ClearCCs(
)
[line 1489]
Clears all recipients assigned in the CC array. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearCustomHeaders
void ClearCustomHeaders(
)
[line 1538]
Clears all custom headers. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
ClearReplyTos
void ClearReplyTos(
)
[line 1507]
Clears all recipients assigned in the ReplyTo array. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
create_body
string create_body(
)
[line 1057]
Assembles the message body. Returns a string if successful or false if unsuccessful.
Tags:
- access - private
Parameters:
[ Top ]
create_header
string create_header(
)
[line 944]
Assembles message header. Returns a string if successful or false if unsuccessful.
Tags:
- access - private
Parameters:
[ Top ]
EmbeddedImageCount
int EmbeddedImageCount(
)
[line 1460]
Returns the number of embedded images in an email.
Tags:
- access - private
Parameters:
[ Top ]
encode_file
string encode_file(
$path, [
$encoding = "base64"])
[line 1246]
Encodes attachment in requested format. Returns a string if successful or false if unsuccessful.
Tags:
- access - private
Parameters:
- $path -
- $encoding -
[ Top ]
encode_header
string encode_header(
$str, [
$position = 'text'])
[line 1299]
Encode a header string to best of Q, B, quoted or none. Returns a string.
Tags:
- access - private
Parameters:
- $str -
- $position -
[ Top ]
encode_q
string encode_q(
$str, [
$position = 'text'])
[line 1376]
Encode string to q encoding. Returns a string.
Tags:
- access - private
Parameters:
- $str -
- $position -
[ Top ]
encode_qp
string encode_qp(
$str)
[line 1353]
Encode string to quoted-printable. Returns a string.
Tags:
- access - private
Parameters:
- $str -
[ Top ]
encode_string
string encode_string(
$str, [
$encoding = "base64"])
[line 1265]
Encodes string to requested format. Returns a string if successful or false if unsuccessful.
Tags:
- access - private
Parameters:
- $str -
- $encoding -
[ Top ]
error_handler
void error_handler(
$msg)
[line 1553]
Adds the error message to the error container.
Returns void.
Tags:
- access - private
Parameters:
- $msg -
[ Top ]
fix_eol
string fix_eol(
$str)
[line 1652]
Changes every end of line from CR or LF to CRLF. Returns string.
Tags:
- access - private
Parameters:
- $str -
[ Top ]
get_server_hostname
string get_server_hostname(
)
[line 1638]
Returns the server hostname or 'localhost.localdomain' if unknown.
Tags:
- access - private
Parameters:
[ Top ]
get_server_var
mixed get_server_var(
$varName)
[line 1616]
Returns the appropriate server variable. Should work with both PHP 4.1.0+ as well as older versions. Returns an empty string if nothing is found.
Tags:
- access - private
Parameters:
- $varName -
[ Top ]
IsHTML
void IsHTML(
$bool)
[line 311]
Sets message type to HTML. Returns void.
Tags:
- access - public
Parameters:
- $bool -
[ Top ]
IsMail
void IsMail(
)
[line 334]
Sets Mailer to send message using PHP mail() function.
Returns void.
Tags:
- access - public
Parameters:
[ Top ]
IsQmail
void IsQmail(
)
[line 353]
Sets Mailer to send message using the qmail MTA. Returns void.
Tags:
- access - public
Parameters:
[ Top ]
IsSendmail
void IsSendmail(
)
[line 344]
Sets Mailer to send message using the $Sendmail program.
Returns void.
Tags:
- access - public
Parameters:
[ Top ]
IsSMTP
void IsSMTP(
)
[line 324]
Sets Mailer to send message using SMTP.
Returns void.
Tags:
- access - public
Parameters:
[ Top ]
mail_send
bool mail_send(
$header,
$body)
[line 619]
Sends mail using the PHP mail() function. Returns bool.
Tags:
- access - private
Parameters:
- $header -
- $body -
[ Top ]
received
string received(
)
[line 1576]
Returns received header for message tracing. Returns string.
Tags:
- access - private
Parameters:
[ Top ]
rfc_date
string rfc_date(
)
[line 1562]
Returns the proper RFC 822 formatted date. Returns string.
Tags:
- access - private
Parameters:
[ Top ]
Send
bool Send(
)
[line 429]
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.
Tags:
- access - public
Parameters:
[ Top ]
sendmail_send
bool sendmail_send(
$header,
$body)
[line 589]
Sends mail using the $Sendmail program. Returns bool.
Tags:
- access - private
Parameters:
- $header -
- $body -
[ Top ]
SendToQueue
string SendToQueue(
$queue_path, [
$send_time = 0])
[line 488]
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.
Tags:
- access - public
Parameters:
- $queue_path -
- $send_time -
[ Top ]
SetWordWrap
void SetWordWrap(
)
[line 922]
Set the body wrapping.
Tags:
- access - private
Parameters:
[ Top ]
smtp_send
bool smtp_send(
$header,
$body)
[line 663]
Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
Tags:
- access - private
Parameters:
- $header -
- $body -
[ Top ]
word_wrap
string word_wrap(
$message,
$length, [
$qp_mode = false])
[line 839]
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
Original written by philippe. Returns string.
Tags:
- access - private
Parameters:
- $message -
- $length -
- $qp_mode -
[ Top ]