PHPMailer
PHPMailer - PHP email transport class
NOTE: Requires PHP version 5 or later
Located in /libraries/phpmailer/phpmailer.php (line 40)
PHPMailer
| Class | Description |
|---|---|
JMail
|
Email Class. Provides a common interface to send email from the Joomla! Platform |
bool
AddAttachment
(string $path, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
bool
AddEmbeddedImage
(string $path, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
void
AddStringAttachment
(string $string, string $filename, [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
void
AddStringEmbeddedImage
( $string, $cid, [ $filename = ''], [ $encoding = 'base64'], [ $type = 'application/octet-stream'])
string
EncodeQPphp
([ $input = ''], [integer $line_max = 76], [ $space_conv = false], string $string)
string
$action_function
= '' (line 321)
Callback Action function name
the function that handles the result of the send email action. Parameters: bool $result result of the send action string $to email address of the recipient string $cc cc email addresses string $bcc bcc email addresses string $subject the subject string $body the email body
mixed
$all_recipients
= array() (line 344)
string
$AltBody
= '' (line 116)
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.
mixed
$attachment
= array() (line 345)
mixed
$bcc
= array() (line 342)
string
$Body
= '' (line 107)
Sets the Body of the message. This can be either an HTML or text body.
If HTML then run IsHTML(true).
mixed
$boundary
= array() (line 348)
mixed
$cc
= array() (line 341)
string
$CharSet
= 'iso-8859-1' (line 56)
Sets the CharSet of the message.
string
$ConfirmReadingTo
= '' (line 169)
Sets the email address that a reading confirmation will be sent.
string
$ContentType
= 'text/plain' (line 62)
Sets the Content-type of the message.
mixed
$CustomHeader
= array() (line 346)
string
$DKIM_domain
= '' (line 301)
Used with DKIM DNS Resource Record
optional, in format of email address 'you@yourdomain.com'
string
$DKIM_identity
= '' (line 288)
Used with DKIM DNS Resource Record
optional, in format of email address 'you@yourdomain.com'
string
$DKIM_passphrase
= '' (line 294)
Used with DKIM DNS Resource Record
string
$DKIM_private
= '' (line 308)
Used with DKIM DNS Resource Record
optional, in format of email address 'you@yourdomain.com'
string
$DKIM_selector
= 'phpmailer' (line 281)
Used with DKIM DNS Resource Record
string
$Encoding
= '8bit' (line 69)
Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
string
$ErrorInfo
= '' (line 75)
Holds the most recent mailer error message.
mixed
$error_count
= 0 (line 350)
mixed
$exceptions
= false (line 354)
string
$From
= 'root@localhost' (line 81)
Sets the From email address for the message.
string
$FromName
= 'Root User' (line 87)
Sets the From name of the message.
string
$Helo
= '' (line 210)
Sets the SMTP HELO of the message (Default is $Hostname).
string
$Host
= 'localhost' (line 198)
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.
string
$Hostname
= '' (line 177)
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'.
mixed
$language
= array() (line 349)
string
$LE
= "\n" (line 275)
Provides the ability to change the line ending
string
$Mailer
= 'mail' (line 150)
Method to send mail: ("mail", "sendmail", or "smtp").
string
$MessageID
= '' (line 184)
Sets the message ID to be used in the Message-Id header.
If empty, a unique id will be generated.
mixed
$message_type
= '' (line 347)
string
$MIMEBody
= '' (line 123)
Stores the complete compiled MIME message body.
string
$MIMEHeader
= '' (line 130)
Stores the complete compiled MIME message headers.
string
$Password
= '' (line 235)
Sets SMTP password.
string
$PluginDir
= '' (line 163)
Path to PHPMailer plugins. Useful if the SMTP class is in a different directory than the PHP include path.
int
$Port
= 25 (line 204)
Sets the default SMTP server port.
int
$Priority
= 3 (line 50)
Email priority (1 = High, 3 = Normal, 5 = low).
mixed
$ReplyTo
= array() (line 343)
string
$Sender
= '' (line 94)
Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
string
$Sendmail
= '/usr/sbin/sendmail' (line 156)
Sets the path of the sendmail program.
string
$SentMIMEMessage
= '' (line 137)
Stores the complete sent MIME message (Body and Headers)
mixed
$sign_cert_file
= '' (line 351)
mixed
$sign_key_file
= '' (line 352)
mixed
$sign_key_pass
= '' (line 353)
bool
$SingleTo
= false (line 263)
Provides the ability to have the TO field process individual
emails, instead of sending to entire TO addresses
bool
$SingleToArray
= array() (line 269)
If SingleTo is true, this provides the array to hold the email addresses
mixed
$smtp
= NULL (line 339)
bool
$SMTPAuth
= false (line 223)
Sets SMTP authentication. Utilizes the Username and Password variables.
bool
$SMTPDebug
= false (line 248)
Sets SMTP class debugging on or off.
bool
$SMTPKeepAlive
= false (line 256)
Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
string
$Subject
= '' (line 100)
Sets the Subject of the message.
int
$Timeout
= 10 (line 242)
Sets the SMTP server timeout in seconds.
This function will not work with the win32 version.
mixed
$to
= array() (line 340)
string
$Username
= '' (line 229)
Sets SMTP username.
string
$Version
= '5.2.1' (line 327)
Sets the PHPMailer Version number
int
$WordWrap
= 0 (line 144)
Sets word wrapping on the body of the message to a given number of characters.
string
$XMailer
= '' (line 333)
What to use in the X-Mailer header
Constructor
- boolean $exceptions: Should we throw external exceptions?
- JMail::__construct() : Constructor
Adds a "To" address.
- string $address
- string $name
Adds an address to one of the recipient arrays
Addresses that have been added already return false, but do not throw exceptions
- string $kind: One of 'to', 'cc', 'bcc', 'ReplyTo'
- string $address: The email address to send to
- string $name
Adds an attachment from a path on the filesystem.
Returns false if the file could not be found or accessed.
- string $path: Path to the attachment.
- string $name: Overrides the attachment name.
- string $encoding: File encoding (see $Encoding).
- string $type: File extension (MIME) type.
Adds a "Bcc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
- string $address
- string $name
Adds a "Cc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
- string $address
- string $name
Adds a custom header.
- $custom_header
Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
- string $path: Path to the attachment.
- string $cid: Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
- string $name: Overrides the attachment name.
- string $encoding: File encoding (see $Encoding).
- string $type: File extension (MIME) type.
Adds a "Reply-to" address.
- string $address
- string $name
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.
- string $string: String attachment data.
- string $filename: Name of the attachment.
- string $encoding: File encoding (see $Encoding).
- string $type: File extension (MIME) type.
- $string
- $cid
- $filename
- $encoding
- $type
Attaches all fs, string, and binary attachments to the message.
Returns an empty string on failure.
- $disposition_type
- $boundary
Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character.
Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
- string $str: multi-byte text to wrap encode
Clears all recipients assigned in the TO array. Returns void.
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
Clears all previously set filesystem, string, and binary attachments. Returns void.
Clears all recipients assigned in the BCC array. Returns void.
Clears all recipients assigned in the ReplyTo array. Returns void.
Assembles the message body. Returns an empty string on failure.
Create the DKIM header, body, as new header
- string $headers_line: Header lines
- string $subject: Subject
- string $body: Body
Generate DKIM Canonicalization Body
- string $body: Message Body
Generate DKIM Canonicalization Header
- string $s: Header
Set the private key file and password to sign the message.
- string $key_filename: Parameter File Name
- string $key_pass: Password for private key
- $txt
- $isSent
- $to
- $cc
- $bcc
- $subject
- $body
Encodes attachment in requested format.
Returns an empty string on failure.
- string $path: The full path to the file
- string $encoding: The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
Encode a header string to best (shortest) of Q, B, quoted or none.
- $str
- $position
Encode string to q encoding.
- string $str: the text to encode
- string $position: Where the text is going to be used, see the RFC for what that means
Encode string to RFC2045 (6.7) quoted-printable format
Uses a PHP5 stream filter to do the encoding about 64x faster than the old version Also results in same content as you started with after decoding
- string $string: the text to encode
- integer $line_max: Number of chars allowed on a line before wrapping
- boolean $space_conv: Dummy param for compatibility with existing EncodeQP function
Encode string to quoted-printable.
Only uses standard PHP, slow, but will always work
- string $string: the text to encode
- integer $line_max: Number of chars allowed on a line before wrapping
- $input
- $space_conv
Encodes string to requested format.
Returns an empty string on failure.
- string $str: The text to encode
- string $encoding: The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
Returns the end of a message boundary.
- $boundary
Returns the start of a message boundary.
- $boundary
- $charSet
- $contentType
- $encoding
Returns the MIME message (headers and body). Only really valid post PreSend().
Checks if a string contains multibyte characters.
- string $str: multi-byte text to wrap encode
Returns a formatted header line.
- $name
- $value
Returns true if an inline attachment is present.
Sends mail using the PHP mail() function.
- string $header: The message headers
- string $body: The message body
Evaluates the message and returns modifications for inline images and backgrounds
- $message
- $basedir
Strips newlines to prevent header injection.
- string $str: String
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.
- JMail::Send() : Send the mail
Sends mail using the $Sendmail program.
- string $header: The message headers
- string $body: The message body
Returns the server hostname or 'localhost.localdomain' if unknown.
Set (or reset) Class Objects (variables)
Usage Example: $page->set('X-Priority', '3');
- string $name: Parameter Name
- mixed $value: Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset
Set the From and FromName properties
- string $address
- string $name
- $auto
Sets the language for all class error messages.
Returns false if it cannot load the language file. The default language is English.
- string $langcode: ISO 639-1 2-character language code (e.g. Portuguese: "br")
- string $lang_path: Path to the language file directory
Set the private key file and password to sign the message.
- string $key_filename: Parameter File Name
- string $key_pass: Password for private key
- $cert_filename
Initiates a connection to an SMTP server.
Returns false if the operation failed.
Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
- string $header: The message headers
- string $body: The message body
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.
Original written by Colin Brown.
- string $encodedText: utf-8 QP text
- int $maxLength: find last character boundary prior to this length
Check that a string looks roughly like an email address should
Static so it can be used without instantiation Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator Conforms approximately to RFC2822
- string $address: The email address to check
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
Original written by philippe.
- string $message: The message to wrap
- integer $length: The line length to wrap to
- boolean $qp_mode: Whether to run in Quoted-Printable mode
Gets the MIME type of the embedded or inline image
- string $ext: File extension
PHPMailer
static