wppaste
WordPress

PHPMailer

Source
wp-includes/PHPMailer/PHPMailer.php:32
PHPMailer - PHP email creation and transport class.

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 79

$Priorityint|nullpublic
Email priority.
$CharSetstringpublic
The character set of the message.
$ContentTypestringpublic
The MIME Content-Type of the message.
$Encodingstringpublic
The message encoding.
$ErrorInfostringpublic
Holds the most recent mailer error message.
$Fromstringpublic
The From email address for the message.
$FromNamestringpublic
The From name of the message.
$Senderstringpublic
The envelope sender of the message.
$Subjectstringpublic
The Subject of the message.
$Bodystringpublic
An HTML or plain text message body.
$AltBodystringpublic
The plain-text message body.
$Icalstringpublic
An iCal message part body.
$IcalMethodsstring[]protected static
Value-array of "method" in Content-Type header "text/calendar"
$MIMEBodystringprotected
The complete compiled MIME message body.
$MIMEHeaderstringprotected
The complete compiled MIME message headers.
$mailHeaderstringprotected
Extra headers that createHeader() doesn't fold in.
$WordWrapintpublic
Word-wrap the message body to this number of chars.
$Mailerstringpublic
Which method to use to send mail.
$Sendmailstringpublic
The path to the sendmail program.
$UseSendmailOptionsboolpublic
Whether mail() uses a fully sendmail-compatible MTA.
$ConfirmReadingTostringpublic
The email address that a reading confirmation should be sent to, also known as read receipt.
$Hostnamestringpublic
The hostname to use in the Message-ID header and as default HELO string.
$MessageIDstringpublic
An ID to be used in the Message-ID header.
$MessageDatestringpublic
The message Date to be used in the Date header.
$Hoststringpublic
SMTP hosts.
$Portintpublic
The default SMTP server port.
$Helostringpublic
The SMTP HELO/EHLO name used for the SMTP connection.
$SMTPSecurestringpublic
What kind of encryption to use on the SMTP connection.
$SMTPAutoTLSboolpublic
Whether to enable TLS encryption automatically if a server supports it, even if SMTPSecure is not set to 'tls'.
$SMTPAuthboolpublic
Whether to use SMTP authentication.
$SMTPOptionsarraypublic
Options array passed to stream_context_create when connecting via SMTP.
$Usernamestringpublic
SMTP username.
$Passwordstringpublic
SMTP password.
$AuthTypestringpublic
SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2.
$SMTPXClientarrayprotected
SMTP SMTPXClient command attributes
$oauthPHPMailer\PHPMailer\OAuthTokenProviderprotected
An implementation of the PHPMailer OAuthTokenProvider interface.
$Timeoutintpublic
The SMTP server timeout in seconds.
$dsnpublic
Comma separated list of DSN notifications 'NEVER' under no circumstances a DSN must be returned to the sender.
$SMTPDebugintpublic
SMTP class debug output mode.
$Debugoutputstring|callable|Psr\Log\LoggerInterfacepublic
How to handle debug output.
$SMTPKeepAliveboolpublic
Whether to keep the SMTP connection open after each message.
$SingleToboolpublic
Whether to split multiple to addresses into multiple messages or send them all in one message.
$SingleToArrayarrayprotected
Storage for addresses when SingleTo is enabled.
$do_verpboolpublic
Whether to generate VERP addresses on send.
$AllowEmptyboolpublic
Whether to allow sending messages with an empty body.
$DKIM_selectorstringpublic
DKIM selector.
$DKIM_identitystringpublic
DKIM Identity.
$DKIM_passphrasestringpublic
DKIM passphrase.
$DKIM_domainstringpublic
DKIM signing domain name.
$DKIM_copyHeaderFieldsboolpublic
DKIM Copy header field values for diagnostic use.
$DKIM_extraHeadersarraypublic
DKIM Extra signing headers.
$DKIM_privatestringpublic
DKIM private key file path.
$DKIM_private_stringstringpublic
DKIM private key string.
$action_functioncallable|PHPMailer\PHPMailer\callable-stringpublic
Callback Action function name.
$XMailerstring|nullpublic
What to put in the X-Mailer header.
$validatorstring|callablepublic static
Which validator to use by default when validating email addresses.
$smtpPHPMailer\PHPMailer\SMTPprotected
An instance of the SMTP sender class.
$toarrayprotected
The array of 'to' names and addresses.
$ccarrayprotected
The array of 'cc' names and addresses.
$bccarrayprotected
The array of 'bcc' names and addresses.
$ReplyToarrayprotected
The array of reply-to names and addresses.
$all_recipientsarrayprotected
An array of all kinds of addresses.
$RecipientsQueuearrayprotected
An array of names and addresses queued for validation.
$ReplyToQueuearrayprotected
An array of reply-to names and addresses queued for validation.
$UseSMTPUTF8boolpublic
Whether the need for SMTPUTF8 has been detected. Set by preSend() if necessary.
$attachmentarrayprotected
The array of attachments.
$CustomHeaderarrayprotected
The array of custom headers.
$lastMessageIDstringprotected
The most recent Message-ID (including angular brackets).
$message_typestringprotected
The message's MIME type.
$boundaryarrayprotected
The array of MIME boundary strings.
$languagearrayprotected static
The array of available text strings for the current language.
$error_countintprotected
The number of errors encountered.
$sign_cert_filestringprotected
The S/MIME certificate file path.
$sign_key_filestringprotected
The S/MIME key file path.
$sign_extracerts_filestringprotected
The optional S/MIME extra certificates ("CA Chain") file path.
$sign_key_passstringprotected
The S/MIME password for the key.
$exceptionsboolprotected
Whether to throw exceptions for errors.
$uniqueidstringprotected
Unique ID used for message ID and boundaries.
$LEstringprotected static
SMTP RFC standard line ending; Carriage Return, Line Feed.

Methods · 129

Source code

class PHPMailer{    const CHARSET_ASCII = 'us-ascii';    const CHARSET_ISO88591 = 'iso-8859-1';    const CHARSET_UTF8 = 'utf-8';     const CONTENT_TYPE_PLAINTEXT = 'text/plain';    const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar';    const CONTENT_TYPE_TEXT_HTML = 'text/html';    const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative';    const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed';    const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related';     const ENCODING_7BIT = '7bit';    const ENCODING_8BIT = '8bit';    const ENCODING_BASE64 = 'base64';    const ENCODING_BINARY = 'binary';    const ENCODING_QUOTED_PRINTABLE = 'quoted-printable';     const ENCRYPTION_STARTTLS = 'tls';    const ENCRYPTION_SMTPS = 'ssl';     const ICAL_METHOD_REQUEST = 'REQUEST';    const ICAL_METHOD_PUBLISH = 'PUBLISH';    const ICAL_METHOD_REPLY = 'REPLY';    const ICAL_METHOD_ADD = 'ADD';    const ICAL_METHOD_CANCEL = 'CANCEL';    const ICAL_METHOD_REFRESH = 'REFRESH';    const ICAL_METHOD_COUNTER = 'COUNTER';    const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER';    const RFC822_DATE_FORMAT = 'D, j M Y H:i:s O';     /**     * Email priority.     * Options: null (default), 1 = High, 3 = Normal, 5 = low.     * When null, the header is not set at all.     *     * @var int|null     */    public $Priority;     /**     * The character set of the message.     *     * @var string     */    public $CharSet = self::CHARSET_ISO88591;     /**     * The MIME Content-Type of the message.     *     * @var string     */    public $ContentType = self::CONTENT_TYPE_PLAINTEXT;     /**     * The message encoding.     * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".     *     * @var string     */    public $Encoding = self::ENCODING_8BIT;     /**     * Holds the most recent mailer error message.     *     * @var string     */    public $ErrorInfo = '';     /**     * The From email address for the message.     *     * @var string     */    public $From = '';     /**     * The From name of the message.     *

Changelog

8 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.1.0
Method sanitiseDate() added.verified against source
7.0.4
Method parseSendmailPath() added.verified against source
6.9.7
Method parseSimplerAddresses() added.verified against source
6.9.7
Method parseEmailString() added.verified against source
6.9.7
Method decodeHeader() added.verified against source
6.9.7
Method addressHasUnicodeLocalPart() added.verified against source
6.9.7
Method anyAddressHasUnicodeLocalPart() added.verified against source
6.9.7
Method needsSMTPUTF8() added.verified against source

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/PHPMailer/PHPMailer.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.