Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

PHPMailer - PHP email creation and transport class. PHP Version 5.5.

Author: Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
Author: Jim Jagielski (jimjag) <jimjag@gmail.com>
Author: Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
Author: Brent R. Matzelle (original founder)
Copyright: 2012 - 2020 Marcus Bointon
Copyright: 2010 - 2012 Jim Jagielski
Copyright: 2004 - 2009 Andy Prevost
License: http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
File Size: 5088 lines (178 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PHPMailer:: (114 methods):
  __construct()
  __destruct()
  mailPassthru()
  edebug()
  isHTML()
  isSMTP()
  isMail()
  isSendmail()
  isQmail()
  addAddress()
  addCC()
  addBCC()
  addReplyTo()
  addOrEnqueueAnAddress()
  addAnAddress()
  parseAddresses()
  setFrom()
  getLastMessageID()
  validateAddress()
  idnSupported()
  punyencodeAddress()
  send()
  preSend()
  postSend()
  sendmailSend()
  isShellSafe()
  isPermittedPath()
  fileIsAccessible()
  mailSend()
  getSMTPInstance()
  setSMTPInstance()
  smtpSend()
  smtpConnect()
  smtpClose()
  setLanguage()
  getTranslations()
  addrAppend()
  addrFormat()
  wrapText()
  utf8CharBoundary()
  setWordWrap()
  createHeader()
  getMailMIME()
  getSentMIMEMessage()
  generateId()
  createBody()
  getBoundary()
  endBoundary()
  setMessageType()
  headerLine()
  textLine()
  addAttachment()
  getAttachments()
  attachAll()
  encodeFile()
  encodeString()
  encodeHeader()
  hasMultiBytes()
  has8bitChars()
  base64EncodeWrapMB()
  encodeQP()
  encodeQ()
  addStringAttachment()
  addEmbeddedImage()
  addStringEmbeddedImage()
  validateEncoding()
  cidExists()
  inlineImageExists()
  attachmentExists()
  alternativeExists()
  clearQueuedAddresses()
  clearAddresses()
  clearCCs()
  clearBCCs()
  clearReplyTos()
  clearAllRecipients()
  clearAttachments()
  clearCustomHeaders()
  setError()
  rfcDate()
  serverHostname()
  isValidHost()
  lang()
  getSmtpErrorMessage()
  isError()
  addCustomHeader()
  getCustomHeaders()
  msgHTML()
  html2text()
  _mime_types()
  filenameToType()
  mb_pathinfo()
  set()
  secureHeader()
  normalizeBreaks()
  stripTrailingWSP()
  getLE()
  setLE()
  sign()
  DKIM_QP()
  DKIM_Sign()
  DKIM_HeaderC()
  DKIM_BodyC()
  DKIM_Add()
  hasLineLongerThanMax()
  quotedString()
  getToAddresses()
  getCcAddresses()
  getBccAddresses()
  getReplyToAddresses()
  getAllRecipientAddresses()
  doCallback()
  getOAuth()
  setOAuth()


Class: PHPMailer  - X-Ref

PHPMailer - PHP email creation and transport class.

__construct($exceptions = null)   X-Ref
Constructor.

param: bool $exceptions Should we throw external exceptions?

__destruct()   X-Ref
Destructor.


mailPassthru($to, $subject, $body, $header, $params)   X-Ref
Call mail() in a safe_mode-aware fashion.
Also, unless sendmail_path points to sendmail (or something that
claims to be sendmail), don't pass params (not a perfect fix,
but it will do).

param: string      $to      To
param: string      $subject Subject
param: string      $body    Message Body
param: string      $header  Additional Header(s)
param: string|null $params  Params
return: bool

edebug($str)   X-Ref
Output debugging info via a user-defined method.
Only generates output if debug output is enabled.

param: string $str

isHTML($isHtml = true)   X-Ref
Sets message type to HTML or plain.

param: bool $isHtml True for HTML mode

isSMTP()   X-Ref
Send messages using SMTP.


isMail()   X-Ref
Send messages using PHP's mail() function.


isSendmail()   X-Ref
Send messages using $Sendmail.


isQmail()   X-Ref
Send messages using qmail.


addAddress($address, $name = '')   X-Ref
Add a "To" address.

param: string $address The email address to send to
param: string $name
return: bool true on success, false if address already used or invalid in some way

addCC($address, $name = '')   X-Ref
Add a "CC" address.

param: string $address The email address to send to
param: string $name
return: bool true on success, false if address already used or invalid in some way

addBCC($address, $name = '')   X-Ref
Add a "BCC" address.

param: string $address The email address to send to
param: string $name
return: bool true on success, false if address already used or invalid in some way

addReplyTo($address, $name = '')   X-Ref
Add a "Reply-To" address.

param: string $address The email address to reply to
param: string $name
return: bool true on success, false if address already used or invalid in some way

addOrEnqueueAnAddress($kind, $address, $name)   X-Ref
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.

param: string $kind    One of 'to', 'cc', 'bcc', or 'ReplyTo'
param: string $address The email address
param: string $name    An optional username associated with the address
return: bool true on success, false if address already used or invalid in some way

addAnAddress($kind, $address, $name = '')   X-Ref
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.

param: string $kind    One of 'to', 'cc', 'bcc', or 'ReplyTo'
param: string $address The email address to send, resp. to reply to
param: string $name
return: bool true on success, false if address already used or invalid in some way

parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591)   X-Ref
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.

param: string $addrstr The address list string
param: bool   $useimap Whether to use the IMAP extension to parse the list
param: string $charset The charset to use when decoding the address list string.
return: array

setFrom($address, $name = '', $auto = true)   X-Ref
Set the From and FromName properties.

param: string $address
param: string $name
param: bool   $auto    Whether to also set the Sender address, defaults to true
return: bool

getLastMessageID()   X-Ref
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.

return: string

validateAddress($address, $patternselect = null)   X-Ref
Check that a string looks like an email address.
Validation patterns supported:
* `auto` Pick best pattern automatically;
* `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0;
* `pcre` Use old PCRE implementation;
* `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
* `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
* `noregex` Don't use a regex: super fast, really dumb.
Alternatively you may pass in a callable to inject your own validator, for example:

```php
PHPMailer::validateAddress('user@example.com', function($address) {
return (strpos($address, '@') !== false);
});
```

You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.

param: string          $address       The email address to check
param: string|callable $patternselect Which pattern to use
return: bool

idnSupported()   X-Ref
Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
`intl` and `mbstring` PHP extensions.

return: bool `true` if required functions for IDN support are present

punyencodeAddress($address)   X-Ref
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:
- No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
- Conversion to punycode is impossible (e.g. required PHP functions are not available)
or fails for any reason (e.g. domain contains characters not allowed in an IDN).

param: string $address The email address to convert
return: string The encoded address in ASCII form

send()   X-Ref
Create a message and send it.
Uses the sending method specified by $Mailer.

return: bool false on error - See the ErrorInfo property for details of the error

preSend()   X-Ref
Prepare a message for sending.

return: bool

postSend()   X-Ref
Actually send a message via the selected mechanism.

return: bool

sendmailSend($header, $body)   X-Ref
Send mail using the $Sendmail program.

param: string $header The message headers
param: string $body   The message body
return: bool

isShellSafe($string)   X-Ref
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.

param: string $string The string to be validated
return: bool

isPermittedPath($path)   X-Ref
Check whether a file path is of a permitted type.
Used to reject URLs and phar files from functions that access local file paths,
such as addAttachment.

param: string $path A relative or absolute path to a file
return: bool

fileIsAccessible($path)   X-Ref
Check whether a file path is safe, accessible, and readable.

param: string $path A relative or absolute path to a file
return: bool

mailSend($header, $body)   X-Ref
Send mail using the PHP mail() function.

param: string $header The message headers
param: string $body   The message body
return: bool

getSMTPInstance()   X-Ref
Get an instance to use for SMTP operations.
Override this function to load your own SMTP implementation,
or set one with setSMTPInstance.

return: SMTP

setSMTPInstance(SMTP $smtp)   X-Ref
Provide an instance to use for SMTP operations.

return: SMTP

smtpSend($header, $body)   X-Ref
Send mail via SMTP.
Returns false if there is a bad MAIL FROM, RCPT, or DATA input.

param: string $header The message headers
param: string $body   The message body
return: bool

smtpConnect($options = null)   X-Ref
Initiate a connection to an SMTP server.
Returns false if the operation failed.

param: array $options An array of options compatible with stream_context_create()
return: bool

smtpClose()   X-Ref
Close the active SMTP session if one exists.


setLanguage($langcode = 'en', $lang_path = '')   X-Ref
Set the language for error messages.
The default language is English.

param: string $langcode  ISO 639-1 2-character language code (e.g. French is "fr")
param: string $lang_path Path to the language file directory, with trailing separator (slash)
return: bool Returns true if the requested language was loaded, false otherwise.

getTranslations()   X-Ref
Get the array of strings for the current language.

return: array

addrAppend($type, $addr)   X-Ref
Create recipient headers.

param: string $type
param: array  $addr An array of recipients,
return: string

addrFormat($addr)   X-Ref
Format an address for use in a message header.

param: array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like
return: string

wrapText($message, $length, $qp_mode = false)   X-Ref
Word-wrap message.
For use with mailers that do not automatically perform wrapping
and for quoted-printable encoded messages.
Original written by philippe.

param: string $message The message to wrap
param: int    $length  The line length to wrap to
param: bool   $qp_mode Whether to run in Quoted-Printable mode
return: string

utf8CharBoundary($encodedText, $maxLength)   X-Ref
Find the last character boundary prior to $maxLength in a utf-8
quoted-printable encoded string.
Original written by Colin Brown.

param: string $encodedText utf-8 QP text
param: int    $maxLength   Find the last character boundary prior to this length
return: int

setWordWrap()   X-Ref
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.


createHeader()   X-Ref
Assemble message headers.

return: string The assembled headers

getMailMIME()   X-Ref
Get the message MIME type headers.

return: string

getSentMIMEMessage()   X-Ref
Returns the whole MIME message.
Includes complete headers and body.
Only valid post preSend().

return: string

generateId()   X-Ref
Create a unique ID to use for boundaries.

return: string

createBody()   X-Ref
Assemble the message body.
Returns an empty string on failure.

return: string The assembled message body

getBoundary($boundary, $charSet, $contentType, $encoding)   X-Ref
Return the start of a message boundary.

param: string $boundary
param: string $charSet
param: string $contentType
param: string $encoding
return: string

endBoundary($boundary)   X-Ref
Return the end of a message boundary.

param: string $boundary
return: string

setMessageType()   X-Ref
Set the message type.
PHPMailer only supports some preset message types, not arbitrary MIME structures.


headerLine($name, $value)   X-Ref
Format a header line.

param: string     $name
param: string|int $value
return: string

textLine($value)   X-Ref
Return a formatted mail line.

param: string $value
return: string

addAttachment($path,$name = '',$encoding = self::ENCODING_BASE64,$type = '',$disposition = 'attachment')   X-Ref
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.
Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client.
If you need to do that, fetch the resource yourself and pass it in via a local file or string.

param: string $path        Path to the attachment
param: string $name        Overrides the attachment name
param: string $encoding    File encoding (see $Encoding)
param: string $type        MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified
param: string $disposition Disposition to use
return: bool

getAttachments()   X-Ref
Return the array of attachments.

return: array

attachAll($disposition_type, $boundary)   X-Ref
Attach all file, string, and binary attachments to the message.
Returns an empty string on failure.

param: string $disposition_type
param: string $boundary
return: string

encodeFile($path, $encoding = self::ENCODING_BASE64)   X-Ref
Encode a file attachment in requested format.
Returns an empty string on failure.

param: string $path     The full path to the file
param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
return: string

encodeString($str, $encoding = self::ENCODING_BASE64)   X-Ref
Encode a string in requested format.
Returns an empty string on failure.

param: string $str      The text to encode
param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
return: string

encodeHeader($str, $position = 'text')   X-Ref
Encode a header value (not including its label) optimally.
Picks shortest of Q, B, or none. Result includes folding if needed.
See RFC822 definitions for phrase, comment and text positions.

param: string $str      The header value to encode
param: string $position What context the string will be used in
return: string

hasMultiBytes($str)   X-Ref
Check if a string contains multi-byte characters.

param: string $str multi-byte text to wrap encode
return: bool

has8bitChars($text)   X-Ref
Does a string contain any 8-bit chars (in any charset)?

param: string $text
return: bool

base64EncodeWrapMB($str, $linebreak = null)   X-Ref
Encode and wrap long multibyte strings for mail headers
without breaking lines within a character.
Adapted from a function by paravoid.

param: string $str       multi-byte text to wrap encode
param: string $linebreak string to use as linefeed/end-of-line
return: string

encodeQP($string)   X-Ref
Encode a string in quoted-printable format.
According to RFC2045 section 6.7.

param: string $string The text to encode
return: string

encodeQ($str, $position = 'text')   X-Ref
Encode a string using Q encoding.

param: string $str      the text to encode
param: string $position Where the text is going to be used, see the RFC for what that means
return: string

addStringAttachment($string,$filename,$encoding = self::ENCODING_BASE64,$type = '',$disposition = 'attachment')   X-Ref
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.

param: string $string      String attachment data
param: string $filename    Name of the attachment
param: string $encoding    File encoding (see $Encoding)
param: string $type        File extension (MIME) type
param: string $disposition Disposition to use
return: bool True on successfully adding an attachment

addEmbeddedImage($path,$cid,$name = '',$encoding = self::ENCODING_BASE64,$type = '',$disposition = 'inline')   X-Ref
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 in `img` tags, for example `<img src="cid:mylogo">`.
Never use a user-supplied path to a file!

param: string $path        Path to the attachment
param: string $cid         Content ID of the attachment; Use this to reference
param: string $name        Overrides the attachment filename
param: string $encoding    File encoding (see $Encoding) defaults to `base64`
param: string $type        File MIME type (by default mapped from the `$path` filename's extension)
param: string $disposition Disposition to use: `inline` (default) or `attachment`
return: bool True on successfully adding an attachment

addStringEmbeddedImage($string,$cid,$name = '',$encoding = self::ENCODING_BASE64,$type = '',$disposition = 'inline')   X-Ref
Add an embedded stringified attachment.
This can include images, sounds, and just about any other document type.
If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type.

param: string $string      The attachment binary data
param: string $cid         Content ID of the attachment; Use this to reference
param: string $name        A filename for the attachment. If this contains an extension,
param: string $encoding    File encoding (see $Encoding), defaults to 'base64'
param: string $type        MIME type - will be used in preference to any automatically derived type
param: string $disposition Disposition to use
return: bool True on successfully adding an attachment

validateEncoding($encoding)   X-Ref
Validate encodings.

param: string $encoding
return: bool

cidExists($cid)   X-Ref
Check if an embedded attachment is present with this cid.

param: string $cid
return: bool

inlineImageExists()   X-Ref
Check if an inline attachment is present.

return: bool

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

return: bool

alternativeExists()   X-Ref
Check if this message has an alternative body set.

return: bool

clearQueuedAddresses($kind)   X-Ref
Clear queued addresses of given kind.

param: string $kind 'to', 'cc', or 'bcc'

clearAddresses()   X-Ref
No description

clearCCs()   X-Ref
Clear all CC recipients.


clearBCCs()   X-Ref
Clear all BCC recipients.


clearReplyTos()   X-Ref
Clear all ReplyTo recipients.


clearAllRecipients()   X-Ref
Clear all recipient types.


clearAttachments()   X-Ref
Clear all filesystem, string, and binary attachments.


clearCustomHeaders()   X-Ref
Clear all custom headers.


setError($msg)   X-Ref
Add an error message to the error container.

param: string $msg

rfcDate()   X-Ref
Return an RFC 822 formatted date.

return: string

serverHostname()   X-Ref
Get the server hostname.
Returns 'localhost.localdomain' if unknown.

return: string

isValidHost($host)   X-Ref
Validate whether a string contains a valid value to use as a hostname or IP address.
IPv6 addresses must include [], e.g. `[::1]`, not just `::1`.

param: string $host The host name or IP address to check
return: bool

lang($key)   X-Ref
Get an error message in the current language.

param: string $key
return: string

getSmtpErrorMessage($base_key)   X-Ref
Build an error message starting with a generic one and adding details if possible.

param: string $base_key
return: string

isError()   X-Ref
Check if an error occurred.

return: bool True if an error did occur

addCustomHeader($name, $value = null)   X-Ref
Add a custom header.
$name value can be overloaded to contain
both header name and value (name:value).

param: string      $name  Custom header name
param: string|null $value Header value

getCustomHeaders()   X-Ref
Returns all custom headers.

return: array

msgHTML($message, $basedir = '', $advanced = false)   X-Ref
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)
Converts data-uri images into embedded attachments.
If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.

param: string        $message  HTML message string
param: string        $basedir  Absolute path to a base directory to prepend to relative paths to images
param: bool|callable $advanced Whether to use the internal HTML to text converter
return: string The transformed message body

html2text($html, $advanced = false)   X-Ref
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 removed for license reasons in #232.
Example usage:

```php
//Use default conversion
$plain = $mail->html2text($html);
//Use your own custom converter
$plain = $mail->html2text($html, function($html) {
$converter = new MyHtml2text($html);
return $converter->get_text();
});
```

param: string        $html     The HTML text to convert
param: bool|callable $advanced Any boolean value to use the internal converter,
return: string

_mime_types($ext = '')   X-Ref
Get the MIME type for a file extension.

param: string $ext File extension
return: string MIME type of file

filenameToType($filename)   X-Ref
Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.

param: string $filename A file name or full path, does not need to exist as a file
return: string

mb_pathinfo($path, $options = null)   X-Ref
Multi-byte-safe pathinfo replacement.
Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.

param: string     $path    A filename or path, does not need to exist as a file
param: int|string $options Either a PATHINFO_* constant,
return: string|array

set($name, $value = '')   X-Ref
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', static::ENCRYPTION_STARTTLS);`
is the same as:
`$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`.

param: string $name  The property name to set
param: mixed  $value The value to set the property to
return: bool

secureHeader($str)   X-Ref
Strip newlines to prevent header injection.

param: string $str
return: string

normalizeBreaks($text, $breaktype = null)   X-Ref
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.

param: string $text
param: string $breaktype What kind of line break to use; defaults to static::$LE
return: string

stripTrailingWSP($text)   X-Ref
Remove trailing breaks from a string.

param: string $text
return: string The text to remove breaks from

getLE()   X-Ref
Return the current line break format string.

return: string

setLE($le)   X-Ref
Set the line break format string, e.g. "\r\n".

param: string $le

sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')   X-Ref
Set the public and private key files and password for S/MIME signing.

param: string $cert_filename
param: string $key_filename
param: string $key_pass            Password for private key
param: string $extracerts_filename Optional path to chain certificate

DKIM_QP($txt)   X-Ref
Quoted-Printable-encode a DKIM header.

param: string $txt
return: string

DKIM_Sign($signHeader)   X-Ref
Generate a DKIM signature.

param: string $signHeader
return: string The DKIM signature value

DKIM_HeaderC($signHeader)   X-Ref
Generate a DKIM canonicalization header.
Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
Canonicalized headers should *always* use CRLF, regardless of mailer setting.

param: string $signHeader Header
return: string

DKIM_BodyC($body)   X-Ref
Generate a DKIM canonicalization body.
Uses the 'simple' algorithm from RFC6376 section 3.4.3.
Canonicalized bodies should *always* use CRLF, regardless of mailer setting.

param: string $body Message Body
return: string

DKIM_Add($headers_line, $subject, $body)   X-Ref
Create the DKIM header and body in a new message header.

param: string $headers_line Header lines
param: string $subject      Subject
param: string $body         Body
return: string

hasLineLongerThanMax($str)   X-Ref
Detect if a string contains a line longer than the maximum line length
allowed by RFC 2822 section 2.1.1.

param: string $str
return: bool

quotedString($str)   X-Ref
If a string contains any "special" characters, double-quote the name,
and escape any double quotes with a backslash.

param: string $str
return: string

getToAddresses()   X-Ref
Allows for public read access to 'to' property.
Before the send() call, queued addresses (i.e. with IDN) are not yet included.

return: array

getCcAddresses()   X-Ref
Allows for public read access to 'cc' property.
Before the send() call, queued addresses (i.e. with IDN) are not yet included.

return: array

getBccAddresses()   X-Ref
Allows for public read access to 'bcc' property.
Before the send() call, queued addresses (i.e. with IDN) are not yet included.

return: array

getReplyToAddresses()   X-Ref
Allows for public read access to 'ReplyTo' property.
Before the send() call, queued addresses (i.e. with IDN) are not yet included.

return: array

getAllRecipientAddresses()   X-Ref
Allows for public read access to 'all_recipients' property.
Before the send() call, queued addresses (i.e. with IDN) are not yet included.

return: array

doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra)   X-Ref
Perform a callback.

param: bool   $isSent
param: array  $to
param: array  $cc
param: array  $bcc
param: string $subject
param: string $body
param: string $from
param: array  $extra

getOAuth()   X-Ref
Get the OAuthTokenProvider instance.

return: OAuthTokenProvider

setOAuth(OAuthTokenProvider $oauth)   X-Ref
Set an OAuthTokenProvider instance.