WPDev.one
Core Class

PHPMailer

class PHPMailer // Constructor: function Object() { [native code] }

PHPMailer - PHP email creation and transport class.

Methods 121 methods

Method / Return Description
__construct()
void

Constructor.

Parameters: $exceptions: mixed
__destruct()
void

Destructor.

mailPassthru()
bool

Call mail() in a safe_mode-aware fashion.

Parameters: $to: mixed, $subject: mixed, $body: mixed, $header: mixed, $params: mixed
edebug()
void

Output debugging info via a user-defined method.

Parameters: $str: mixed
isHTML()
void

Sets message type to HTML or plain.

Parameters: $isHtml: mixed
isSMTP()
void

Send messages using SMTP.

isMail()
void

Send messages using PHP's mail() function.

isSendmail()
void

Send messages using $Sendmail.

isQmail()
void

Send messages using qmail.

addAddress()
bool

Add a "To" address.

Parameters: $address: mixed, $name: mixed
addCC()
bool

Add a "CC" address.

Parameters: $address: mixed, $name: mixed
addBCC()
bool

Add a "BCC" address.

Parameters: $address: mixed, $name: mixed
addReplyTo()
bool

Add a "Reply-To" address.

Parameters: $address: mixed, $name: mixed
addOrEnqueueAnAddress()
bool

Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer

Parameters: $kind: mixed, $address: mixed, $name: mixed
setBoundaries()
void

Set the boundaries to use for delimiting MIME parts.

addAnAddress()
bool

Add an address to one of the recipient arrays or to the ReplyTo array.

Parameters: $kind: mixed, $address: mixed, $name: mixed
parseAddresses()
array

Parse and validate a string containing one or more RFC822-style comma-separated email addresses

Parameters: $addrstr: mixed, $useimap: mixed, $charset: mixed
setFrom()
bool

Set the From and FromName properties.

Parameters: $address: mixed, $name: mixed, $auto: mixed
getLastMessageID()
string

Return the Message-ID header of the last email.

validateAddress()
bool

Check that a string looks like an email address.

Parameters: $address: mixed, $patternselect: mixed
idnSupported()
bool

Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the

punyencodeAddress()
string

Converts IDN in given email address to its ASCII form, also known as punycode, if possible.

Parameters: $address: mixed
send()
bool

Create a message and send it.

preSend()
bool

Prepare a message for sending.

postSend()
bool

Actually send a message via the selected mechanism.

sendmailSend()
bool

Send mail using the $Sendmail program.

Parameters: $header: mixed, $body: mixed
isShellSafe()
bool

Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.

Parameters: $string: mixed
isPermittedPath()
bool

Check whether a file path is of a permitted type.

Parameters: $path: mixed
fileIsAccessible()
bool

Check whether a file path is safe, accessible, and readable.

Parameters: $path: mixed
mailSend()
bool

Send mail using the PHP mail() function.

Parameters: $header: mixed, $body: mixed
getSMTPInstance()
SMTP

Get an instance to use for SMTP operations.

setSMTPInstance()
SMTP

Provide an instance to use for SMTP operations.

Parameters: $smtp: SMTP
setSMTPXclientAttribute()
bool

Provide SMTP XCLIENT attributes

Parameters: $name: mixed, $value: mixed
getSMTPXclientAttributes()
array

Get SMTP XCLIENT attributes

smtpSend()
bool

Send mail via SMTP.

Parameters: $header: mixed, $body: mixed
smtpConnect()
bool

Initiate a connection to an SMTP server.

Parameters: $options: mixed
smtpClose()
void

Close the active SMTP session if one exists.

setLanguage()
bool

Set the language for error messages.

Parameters: $langcode: mixed, $lang_path: mixed
getTranslations()
array

Get the array of strings for the current language.

addrAppend()
string

Create recipient headers.

Parameters: $type: mixed, $addr: mixed
addrFormat()
string

Format an address for use in a message header.

Parameters: $addr: mixed
wrapText()
string

Word-wrap message.

Parameters: $message: mixed, $length: mixed, $qp_mode: mixed
utf8CharBoundary()
int

Find the last character boundary prior to $maxLength in a utf-8

Parameters: $encodedText: mixed, $maxLength: mixed
setWordWrap()
void

Apply word wrapping to the message body.

createHeader()
string

Assemble message headers.

getMailMIME()
string

Get the message MIME type headers.

getSentMIMEMessage()
string

Returns the whole MIME message.

generateId()
string

Create a unique ID to use for boundaries.

createBody()
string

Assemble the message body.

getBoundaries()
array

Get the boundaries that this message will use

getBoundary()
string

Return the start of a message boundary.

Parameters: $boundary: mixed, $charSet: mixed, $contentType: mixed, $encoding: mixed
endBoundary()
string

Return the end of a message boundary.

Parameters: $boundary: mixed
setMessageType()
void

Set the message type.

headerLine()
string

Format a header line.

Parameters: $name: mixed, $value: mixed
textLine()
string

Return a formatted mail line.

Parameters: $value: mixed
addAttachment()
bool

Add an attachment from a path on the filesystem.

Parameters: $path: mixed, $name: mixed, $encoding: mixed, $type: mixed, $disposition: mixed
getAttachments()
array

Return the array of attachments.

attachAll()
string

Attach all file, string, and binary attachments to the message.

Parameters: $disposition_type: mixed, $boundary: mixed
encodeFile()
string

Encode a file attachment in requested format.

Parameters: $path: mixed, $encoding: mixed
encodeString()
string

Encode a string in requested format.

Parameters: $str: mixed, $encoding: mixed
encodeHeader()
string

Encode a header value (not including its label) optimally.

Parameters: $str: mixed, $position: mixed
hasMultiBytes()
bool

Check if a string contains multi-byte characters.

Parameters: $str: mixed
has8bitChars()
bool

Does a string contain any 8-bit chars (in any charset)?

Parameters: $text: mixed
base64EncodeWrapMB()
string

Encode and wrap long multibyte strings for mail headers

Parameters: $str: mixed, $linebreak: mixed
encodeQP()
string

Encode a string in quoted-printable format.

Parameters: $string: mixed
encodeQ()
string

Encode a string using Q encoding.

Parameters: $str: mixed, $position: mixed
addStringAttachment()
bool

Add a string or binary attachment (non-filesystem).

Parameters: $string: mixed, $filename: mixed, $encoding: mixed, $type: mixed, $disposition: mixed
addEmbeddedImage()
bool

Add an embedded (inline) attachment from a file.

Parameters: $path: mixed, $cid: mixed, $name: mixed, $encoding: mixed, $type: mixed, $disposition: mixed
addStringEmbeddedImage()
bool

Add an embedded stringified attachment.

Parameters: $string: mixed, $cid: mixed, $name: mixed, $encoding: mixed, $type: mixed, $disposition: mixed
validateEncoding()
bool

Validate encodings.

Parameters: $encoding: mixed
cidExists()
bool

Check if an embedded attachment is present with this cid.

Parameters: $cid: mixed
inlineImageExists()
bool

Check if an inline attachment is present.

attachmentExists()
bool

Check if an attachment (non-inline) is present.

alternativeExists()
bool

Check if this message has an alternative body set.

clearQueuedAddresses()
void

Clear queued addresses of given kind.

Parameters: $kind: mixed
clearAddresses()
void

Clear all To recipients.

clearCCs()
void

Clear all CC recipients.

clearBCCs()
void

Clear all BCC recipients.

clearReplyTos()
void

Clear all ReplyTo recipients.

clearAllRecipients()
void

Clear all recipient types.

clearAttachments()
void

Clear all filesystem, string, and binary attachments.

clearCustomHeaders()
void

Clear all custom headers.

clearCustomHeader()
bool

Clear a specific custom header by name or name and value.

Parameters: $name: mixed, $value: mixed
replaceCustomHeader()
bool

Replace a custom header.

Parameters: $name: mixed, $value: mixed
setError()
void

Add an error message to the error container.

Parameters: $msg: mixed
rfcDate()
string

Return an RFC 822 formatted date.

serverHostname()
string

Get the server hostname.

isValidHost()
bool

Validate whether a string contains a valid value to use as a hostname or IP address.

Parameters: $host: mixed
lang()
string

Get an error message in the current language.

Parameters: $key: mixed
getSmtpErrorMessage()
string

Build an error message starting with a generic one and adding details if possible.

Parameters: $base_key: mixed
isError()
bool

Check if an error occurred.

addCustomHeader()
bool

Add a custom header.

Parameters: $name: mixed, $value: mixed
getCustomHeaders()
array

Returns all custom headers.

msgHTML()
string

Create a message body from an HTML string.

Parameters: $message: mixed, $basedir: mixed, $advanced: mixed
html2text()
string

Convert an HTML string into plain text.

Parameters: $html: mixed, $advanced: mixed
_mime_types()
string

Get the MIME type for a file extension.

Parameters: $ext: mixed
filenameToType()
string

Map a file name to a MIME type.

Parameters: $filename: mixed
mb_pathinfo()
(string

Multi-byte-safe pathinfo replacement.

Parameters: $path: mixed, $options: mixed
set()
bool

Set or reset instance properties.

Parameters: $name: mixed, $value: mixed
secureHeader()
string

Strip newlines to prevent header injection.

Parameters: $str: mixed
normalizeBreaks()
string

Normalize line breaks in a string.

Parameters: $text: mixed, $breaktype: mixed
stripTrailingWSP()
string

Remove trailing whitespace from a string.

Parameters: $text: mixed
stripTrailingBreaks()
string

Strip trailing line breaks from a string.

Parameters: $text: mixed
getLE()
string

Return the current line break format string.

setLE()
void

Set the line break format string, e.g. "\r\n".

Parameters: $le: mixed
sign()
void

Set the public and private key files and password for S/MIME signing.

Parameters: $cert_filename: mixed, $key_filename: mixed, $key_pass: mixed, $extracerts_filename: mixed
DKIM_QP()
string

Quoted-Printable-encode a DKIM header.

Parameters: $txt: mixed
DKIM_Sign()
string

Generate a DKIM signature.

Parameters: $signHeader: mixed
DKIM_HeaderC()
string

Generate a DKIM canonicalization header.

Parameters: $signHeader: mixed
DKIM_BodyC()
string

Generate a DKIM canonicalization body.

Parameters: $body: mixed
DKIM_Add()
string

Create the DKIM header and body in a new message header.

Parameters: $headers_line: mixed, $subject: mixed, $body: mixed
hasLineLongerThanMax()
bool

Detect if a string contains a line longer than the maximum line length

Parameters: $str: mixed
quotedString()
string

If a string contains any "special" characters, double-quote the name,

Parameters: $str: mixed
getToAddresses()
array

Allows for public read access to 'to' property.

getCcAddresses()
array

Allows for public read access to 'cc' property.

getBccAddresses()
array

Allows for public read access to 'bcc' property.

getReplyToAddresses()
array

Allows for public read access to 'ReplyTo' property.

getAllRecipientAddresses()
array

Allows for public read access to 'all_recipients' property.

doCallback()
void

Perform a callback.

Parameters: $isSent: mixed, $to: mixed, $cc: mixed, $bcc: mixed, $subject: mixed, $body: mixed, $from: mixed, $extra: mixed
getOAuth()
OAuthTokenProvider

Get the OAuthTokenProvider instance.

setOAuth()
void

Set an OAuthTokenProvider instance.

Parameters: $oauth: OAuthTokenProvider

Properties

Property / Type Description
$Priority
mixed
public
No description available.
$CharSet
mixed
public
No description available.
$ContentType
mixed
public
No description available.
$Encoding
mixed
public
No description available.
$ErrorInfo
mixed
public
No description available.
$From
mixed
public
No description available.
$FromName
mixed
public
No description available.
$Sender
mixed
public
No description available.
$Subject
mixed
public
No description available.
$Body
mixed
public
No description available.
$AltBody
mixed
public
No description available.
$Ical
mixed
public
No description available.
$IcalMethods
mixed
public
No description available.
$MIMEBody
mixed
public
No description available.
$MIMEHeader
mixed
public
No description available.
$mailHeader
mixed
public
No description available.
$WordWrap
mixed
public
No description available.
$Mailer
mixed
public
No description available.
$Sendmail
mixed
public
No description available.
$UseSendmailOptions
mixed
public
No description available.
$ConfirmReadingTo
mixed
public
No description available.
$Hostname
mixed
public
No description available.
$MessageID
mixed
public
No description available.
$MessageDate
mixed
public
No description available.
$Host
mixed
public
No description available.
$Port
mixed
public
No description available.
$Helo
mixed
public
No description available.
$SMTPSecure
mixed
public
No description available.
$SMTPAutoTLS
mixed
public
No description available.
$SMTPAuth
mixed
public
No description available.
$SMTPOptions
mixed
public
No description available.
$Username
mixed
public
No description available.
$Password
mixed
public
No description available.
$AuthType
mixed
public
No description available.
$SMTPXClient
mixed
public
No description available.
$oauth
mixed
public
No description available.
$Timeout
mixed
public
No description available.
$dsn
mixed
public
No description available.
$SMTPDebug
mixed
public
No description available.
$Debugoutput
mixed
public
No description available.
$SMTPKeepAlive
mixed
public
No description available.
$SingleTo
mixed
public
No description available.
$SingleToArray
mixed
public
No description available.
$do_verp
mixed
public
No description available.
$AllowEmpty
mixed
public
No description available.
$DKIM_selector
mixed
public
No description available.
$DKIM_identity
mixed
public
No description available.
$DKIM_passphrase
mixed
public
No description available.
$DKIM_domain
mixed
public
No description available.
$DKIM_copyHeaderFields
mixed
public
No description available.
$DKIM_extraHeaders
mixed
public
No description available.
$DKIM_private
mixed
public
No description available.
$DKIM_private_string
mixed
public
No description available.
$action_function
mixed
public
No description available.
$XMailer
mixed
public
No description available.
$validator
mixed
public
No description available.
$smtp
mixed
public
No description available.
$to
mixed
public
No description available.
$cc
mixed
public
No description available.
$bcc
mixed
public
No description available.
$ReplyTo
mixed
public
No description available.
$all_recipients
mixed
public
No description available.
$RecipientsQueue
mixed
public
No description available.
$ReplyToQueue
mixed
public
No description available.
$attachment
mixed
public
No description available.
$CustomHeader
mixed
public
No description available.
$lastMessageID
mixed
public
No description available.
$message_type
mixed
public
No description available.
$boundary
mixed
public
No description available.
$language
mixed
public
No description available.
$error_count
mixed
public
No description available.
$sign_cert_file
mixed
public
No description available.
$sign_key_file
mixed
public
No description available.
$sign_extracerts_file
mixed
public
No description available.
$sign_key_pass
mixed
public
No description available.
$exceptions
mixed
public
No description available.
$uniqueid
mixed
public
No description available.
$LE
mixed
public
No description available.

Class Information

Source File
wp-includes/PHPMailer/PHPMailer.php
Advertisement