PHPMailer - PHP email creation and transport class.
Located in /class.phpmailer.php (line 28)
Class | Description |
---|---|
PHPMailerOAuth | PHPMailerOAuth - PHPMailer subclass adding OAuth support. |
Which validator to use by default when validating email addresses.
May be a callable to inject your own validator, but there are several built-in validators.
Callback Action function name.
The function that handles the result of the send email action. It is called out by send() for each email sent.
Value can be any php callable: http://www.php.net/is_callable
Parameters: boolean $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 string $from email address of sender
Whether to allow sending messages with an empty body.
An array of all kinds of addresses.
Includes all of $to, $cc, $bcc
The plain-text message body.
This body can be read by mail clients that do not have HTML email capability such as mutt & Eudora. Clients that can read HTML will view the normal Body.
The array of attachments.
SMTP auth type.
Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
The array of 'bcc' names and addresses.
An HTML or plain text message body.
If HTML then call isHTML(true).
The array of MIME boundary strings.
The array of 'cc' names and addresses.
The character set of the message.
The email address that a reading confirmation should be sent to, also known as read receipt.
The MIME Content-type of the message.
The array of custom headers.
How to handle debug output.
Options: * `echo` Output plain-text as-is, appropriate for CLI * `html` Output escaped, line breaks converted to `
`, appropriate for browser output * `error_log` Output to error log as configured in php.ini
Alternatively, you can provide a callable expecting two params: a message string and the debug level:
DKIM signing domain name.
DKIM Identity.
Usually the email address used as the source of the email.
DKIM passphrase.
Used if your key is encrypted.
DKIM private key file path.
DKIM private key string.
If set, takes precedence over `$DKIM_private`.
DKIM selector.
Whether to generate VERP addresses on send.
Only applicable when sending via SMTP.
The message encoding.
Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
Holds the most recent mailer error message.
The number of errors encountered.
Whether to throw exceptions for errors.
The From email address for the message.
The From name of the message.
The SMTP HELO of the message.
Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find one with the same method described above for $Hostname.
SMTP hosts.
Either a single hostname or multiple semicolon-delimited hostnames. 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"). You can also specify encryption type, for example: (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). Hosts will be tried in order.
The hostname to use in the Message-ID header and as default HELO string.
If empty, PHPMailer attempts to find one with, in order, $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value 'localhost.localdomain'.
An iCal message part body.
Only supported in simple alt or alt_inline message types To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
The array of available languages.
The most recent Message-ID (including angular brackets).
The default line ending.
Which method to use to send mail.
Options: "mail", "sendmail", or "smtp".
Extra headers that createHeader() doesn't fold in.
The message Date to be used in the Date header.
If empty, the current date will be added.
An ID to be used in the Message-ID header.
If empty, a unique id will be generated. You can set your own, but it must be in the format "<id@domain>", as defined in RFC5322 section 3.6.4 or it will be ignored.
The message's MIME type.
The complete compiled MIME message body.
The complete compiled MIME message headers.
SMTP password.
Path to PHPMailer plugins.
Useful if the SMTP class is not in the PHP include path.
The default SMTP server port.
Email priority.
Options: null (default), 1 = High, 3 = Normal, 5 = low. When null, the header is not set at all.
SMTP realm.
Used for NTLM auth
An array of names and addresses queued for validation.
In send(), valid and non duplicate entries are moved to $all_recipients and one of $to, $cc, or $bcc. This array is used only for addresses with IDN.
The array of reply-to names and addresses.
An array of reply-to names and addresses queued for validation.
In send(), valid and non duplicate entries are moved to $ReplyTo. This array is used only for addresses with IDN.
The Return-Path of the message.
If empty, it will be set to either From or Sender.
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.
The path to the sendmail program.
The S/MIME certificate file path.
The optional S/MIME extra certificates ("CA Chain") file path.
The S/MIME key file path.
The S/MIME password for the key.
Used only if the key is encrypted.
Whether to split multiple to addresses into multiple messages or send them all in one message.
Only supported in `mail` and `sendmail` transports, not in SMTP.
Storage for addresses when SingleTo is enabled.
An instance of the SMTP sender class.
Whether to use SMTP authentication.
Uses the Username and Password properties.
Whether to enable TLS encryption automatically if a server supports it, even if `SMTPSecure` is not set to 'tls'.
Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
SMTP class debug output mode.
Debug output level. Options: * `0` No output * `1` Commands * `2` Data and commands * `3` As 2 plus connection status * `4` Low-level data output
Whether to keep SMTP connection open after each message.
If this is set to true then to close the connection requires an explicit call to smtpClose().
Options array passed to stream_context_create when connecting via SMTP.
What kind of encryption to use on the SMTP connection.
Options: '', 'ssl' or 'tls'
The Subject of the message.
The SMTP server timeout in seconds.
Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
The array of 'to' names and addresses.
Unique ID used for message ID and boundaries.
SMTP username.
Whether mail() uses a fully sendmail-compatible MTA.
One which supports sendmail's "-oi -f" options.
The PHPMailer Version number.
Word-wrap the message body to this number of chars.
Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
SMTP workstation.
Used for NTLM auth
What to put in the X-Mailer header.
Options: An empty string for PHPMailer default, whitespace for none, or a string to use
Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
Detect if a string contains a line longer than the maximum line length allowed.
Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
Multi-byte-safe pathinfo replacement.
Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. Works similarly to the one in PHP >= 5.2.0
Normalize line breaks in a string.
Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. Defaults to CRLF (for message bodies) and preserves consecutive breaks.
Return an RFC 822 formatted date.
Check that a string looks like an email address.
Get the MIME type for a file extension.
Constructor.
Destructor.
Add a "To" address.
Add an address to one of the recipient arrays or to the ReplyTo array.
Addresses that have been added already return false, but do not throw exceptions.
Add an attachment from a path on the filesystem.
Never use a user-supplied path to a file! Returns false if the file could not be found or read.
Add a "BCC" address.
Add a "CC" address.
Add a custom header.
$name value can be overloaded to contain both header name and value (name:value)
Add an embedded (inline) attachment from a file.
This can include images, sounds, and just about any other document type. These differ from 'regular' attachments in that they are intended to be displayed inline with the message, not just attached for download. This is used in HTML messages that embed the images the HTML refers to using the $cid value. Never use a user-supplied path to a file!
Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still be modified after calling this function), addition of such addresses is delayed until send().
Addresses that have been added already return false, but do not throw exceptions.
Create recipient headers.
Add a "Reply-To" address.
Format an address for use in a message header.
Add a string or binary attachment (non-filesystem).
This method can be used to attach ascii or binary data, such as a BLOB record from a database.
Add an embedded stringified attachment.
This can include images, sounds, and just about any other document type. Be sure to set the $type to an image type for images: JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
Check if this message has an alternative body set.
Attach all file, string, and binary attachments to the message.
Returns an empty string on failure.
Check if an attachment (non-inline) is present.
Encode and wrap long multibyte strings for mail headers without breaking lines within a character.
Adapted from a function by paravoid
Clear all To recipients.
Clear all recipient types.
Clear all filesystem, string, and binary attachments.
Clear all BCC recipients.
Clear all CC recipients.
Clear all custom headers.
Clear queued addresses of given kind.
Clear all ReplyTo recipients.
Assemble the message body.
Returns an empty string on failure.
Assemble message headers.
Create the DKIM header and body in a new message header.
Generate a DKIM canonicalization body.
Generate a DKIM canonicalization header.
Quoted-Printable-encode a DKIM header.
Generate a DKIM signature.
Perform a callback.
Output debugging info via user-defined method.
Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
Encode a file attachment in requested format.
Returns an empty string on failure.
Encode a header string optimally.
Picks shortest of Q, B, quoted-printable or none.
Encode a string using Q encoding.
Encode a string in quoted-printable format.
According to RFC2045 section 6.7.
Backward compatibility wrapper for an old QP encoding function that was removed.
Encode a string in requested format.
Returns an empty string on failure.
Return the end of a message boundary.
Ensure consistent line endings in a string.
Changes every end of line from CRLF, CR or LF to $this->LE.
Create unique ID
Allows for public read access to 'all_recipients' property.
Return the array of attachments.
Allows for public read access to 'bcc' property.
Return the start of a message boundary.
Allows for public read access to 'cc' property.
Returns all custom headers.
Return the Message-ID header of the last email.
Technically this is the value from the last time the headers were created, but it's also the message ID of the last sent message except in pathological cases.
Get the message MIME type headers.
Allows for public read access to 'ReplyTo' property.
Returns the whole MIME message.
Includes complete headers and body. Only valid post preSend().
Get an instance to use for SMTP operations.
Override this function to load your own SMTP implementation
Allows for public read access to 'to' property.
Get the array of strings for the current language.
Does a string contain any 8-bit chars (in any charset)?
Check if a string contains multi-byte characters.
Format a header line.
Convert an HTML string into plain text.
This is used by msgHTML(). Note - older versions of this function used a bundled advanced converter which was been removed for license reasons in #232. Example usage:
Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the "intl" and "mbstring" PHP extensions.
Check if an inline attachment is present.
Check if an error occurred.
Sets message type to HTML or plain.
Send messages using PHP's mail() function.
Send messages using qmail.
Send messages using $Sendmail.
Send messages using SMTP.
Get an error message in the current language.
Send mail using the PHP mail() function.
Create a message body from an HTML string.
Automatically inlines images and creates a plain-text version by converting the HTML, overwriting any existing values in Body and AltBody. Do not source $message content from user input! $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty will look for an image file in $basedir/images/a.png and convert it to inline. If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
Parse and validate a string containing one or more RFC822-style comma-separated email addresses of the form "display name <address>" into an array of name/address pairs.
Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. Note that quotes in the name part are removed.
Actually send a message.
Send the email via the selected mechanism
Prepare a message for sending.
Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. This function silently returns unmodified address if:
Strip newlines to prevent header injection.
Create a message and send it.
Uses the sending method specified by $Mailer.
Send mail using the $Sendmail program.
Get the server hostname.
Returns 'localhost.localdomain' if unknown.
Set or reset instance properties.
You should avoid this function - it's more verbose, less efficient, more error-prone and harder to debug than setting properties directly. Usage Example: `$mail->set('SMTPSecure', 'tls');` is the same as: `$mail->SMTPSecure = 'tls';`
Add an error message to the error container.
Set the From and FromName properties.
Set the language for error messages.
Returns false if it cannot load the language file. The default language is English.
Set the message type.
PHPMailer only supports some preset message types, not arbitrary MIME structures.
Apply word wrapping to the message body.
Wraps the message body to the number of chars set in the WordWrap property. You should only do this to plain-text bodies as wrapping HTML tags may break them. This is called automatically by createBody(), so you don't need to call it yourself.
Set the public and private key files and password for S/MIME signing.
Close the active SMTP session if one exists.
Initiate a connection to an SMTP server.
Returns false if the operation failed.
Send mail via SMTP.
Returns false if there is a bad MAIL FROM, RCPT, or DATA input. Uses the PHPMailerSMTP class by default.
Return a formatted mail line.
Find the last character boundary prior to $maxLength in a utf-8 quoted-printable encoded string.
Original written by Colin Brown.
Word-wrap message.
For use with mailers that do not automatically perform wrapping and for quoted-printable encoded messages. Original written by philippe.
SMTP RFC standard line ending.
The maximum line length allowed by RFC 2822 section 2.1.1
Error severity: message, likely ok to continue processing.
Error severity: message, plus full stop, critical error reached.
Error severity: message only, continue processing.
Documentation generated on Mon, 09 Jan 2017 11:55:20 +0000 by phpDocumentor 1.4.3