Methods |
public
|
__construct(boolean $exceptions = null)
Constructor.
Parameters
$exceptions |
Should we throw external exceptions?
|
Overriden by
|
#
|
public
|
__destruct()
Destructor.
|
#
|
protected
|
edebug(string $str)
Output debugging info via user-defined method.
Only generates output if SMTP debug output is enabled (@see SMTP::$do…
Output debugging info via user-defined method.
Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
|
#
|
public
|
isHTML(boolean $isHtml = true): void
Sets message type to HTML or plain.
Sets message type to HTML or plain.
Parameters
$isHtml |
True for HTML mode.
|
|
#
|
public
|
isSMTP(): void
Send messages using SMTP.
Send messages using SMTP.
|
#
|
public
|
isMail(): void
Send messages using PHP's mail() function.
Send messages using PHP's mail() function.
|
#
|
public
|
isSendmail(): void
Send messages using $Sendmail.
Send messages using $Sendmail.
|
#
|
public
|
isQmail(): void
Send messages using qmail.
Send messages using qmail.
|
#
|
public
|
addAddress(string $address, string $name = ''): boolean
Add a "To" address.
Parameters
$address |
The email address to send to
|
Returns
true on success, false if address already used or invalid in some way
|
#
|
public
|
addCC(string $address, string $name = ''): boolean
Add a "CC" address.
Parameters
$address |
The email address to send to
|
Returns
true on success, false if address already used or invalid in some way
|
#
|
public
|
addBCC(string $address, string $name = ''): boolean
Add a "BCC" address.
Parameters
$address |
The email address to send to
|
Returns
true on success, false if address already used or invalid in some way
|
#
|
public
|
addReplyTo(string $address, string $name = ''): boolean
Add a "Reply-To" address.
Add a "Reply-To" address.
Parameters
$address |
The email address to reply to
|
Returns
true on success, false if address already used or invalid in some way
|
#
|
protected
|
addOrEnqueueAnAddress(string $kind, string $address, string $name): boolean
Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
can't validate addresses with…
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.
Parameters
$kind |
One of 'to', 'cc', 'bcc', or 'ReplyTo'
|
$address |
The email address to send, resp. to reply to
|
Returns
true on success, false if address already used or invalid in some way
Throws
|
#
|
protected
|
addAnAddress(string $kind, string $address, string $name = ''): boolean
Add an address to one of the recipient arrays or to the ReplyTo array.
Addresses that have been added already return…
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.
Parameters
$kind |
One of 'to', 'cc', 'bcc', or 'ReplyTo'
|
$address |
The email address to send, resp. to reply to
|
Returns
true on success, false if address already used or invalid in some way
Throws
|
#
|
public
|
parseAddresses(string $addrstr, bool $useimap = true): array
Parse and validate a string containing one or more RFC822-style comma-separated email addresses
of the form "display…
Parse and validate a string containing one or more RFC822-style comma-separated email addresses
of the form "display name " 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.
Parameters
$addrstr |
The address list string
|
$useimap |
Whether to use the IMAP extension to parse the list
|
|
#
|
public
|
setFrom(string $address, string $name = '', boolean $auto = true): boolean
Set the From and FromName properties.
Set the From and FromName properties.
Parameters
$auto |
Whether to also set the Sender address, defaults to true
|
Throws
|
#
|
public
|
getLastMessageID(): string
Return the Message-ID header of the last email.
Technically this is the value from the last time the headers were…
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.
|
#
|
public
static
|
validateAddress(string $address, string|callable $patternselect = null): boolean
Check that a string looks like an email address.
Check that a string looks like an email address.
Parameters
$address |
The email address to check
|
$patternselect |
A selector for the validation pattern to use :
-
auto Pick best pattern automatically;
-
pcre8 Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
-
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:
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.
|
|
#
|
public
|
idnSupported(): bool
Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
"intl" and "mbstring" PHP…
Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
"intl" and "mbstring" PHP extensions.
Returns
"true" if required functions for IDN support are present
|
#
|
public
|
punyencodeAddress(string $address): string
Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
Important: Address must be…
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 has characters not allowed in an IDN)
Parameters
$address |
The email address to convert
|
Returns
The encoded address in ASCII form
|
#
|
public
|
send(): boolean
Create a message and send it.
Uses the sending method specified by $Mailer.
Create a message and send it.
Uses the sending method specified by $Mailer.
Returns
false on error - See the ErrorInfo property for details of the error.
Throws
|
#
|
public
|
preSend(): boolean
Prepare a message for sending.
Prepare a message for sending.
Throws
|
#
|
public
|
postSend(): boolean
Actually send a message.
Send the email via the selected mechanism
Actually send a message.
Send the email via the selected mechanism
Throws
|
#
|
protected
|
sendmailSend(string $header, string $body): boolean
Send mail using the $Sendmail program.
Send mail using the $Sendmail program.
Parameters
$header |
The message headers
|
$body |
The message body
|
Throws
|
#
|
protected
static
|
isShellSafe(string $string): boolean
Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
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.
Parameters
$string |
The string to be validated
|
|
#
|
protected
static
|
isPermittedPath(string $path): bool
Check whether a file path is of a permitted type.
Used to reject URLs and phar files from functions that access local…
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.
Parameters
$path |
A relative or absolute path to a file.
|
|
#
|
protected
|
mailSend(string $header, string $body): boolean
Send mail using the PHP mail() function.
Send mail using the PHP mail() function.
Parameters
$header |
The message headers
|
$body |
The message body
|
Throws
|
#
|
public
|
getSMTPInstance(): SMTP
Get an instance to use for SMTP operations.
Override this function to load your own SMTP implementation
Get an instance to use for SMTP operations.
Override this function to load your own SMTP implementation
|
#
|
protected
|
smtpSend(string $header, string $body): boolean
Send mail via SMTP.
Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
Uses the PHPMailerSMTP class by…
Send mail via SMTP.
Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
Uses the PHPMailerSMTP class by default.
Parameters
$header |
The message headers
|
$body |
The message body
|
Throws
|
#
|
public
|
smtpConnect(array $options = null): boolean
Initiate a connection to an SMTP server.
Returns false if the operation failed.
Initiate a connection to an SMTP server.
Returns false if the operation failed.
Parameters
$options |
An array of options compatible with stream_context_create()
|
Throws
Overriden by
|
#
|
public
|
smtpClose(): void
Close the active SMTP session if one exists.
Close the active SMTP session if one exists.
|
#
|
public
|
setLanguage(string $langcode = 'en', string $lang_path = ''): boolean
Set the language for error messages.
Returns false if it cannot load the language file.
The default language is English.
Set the language for error messages.
Returns false if it cannot load the language file.
The default language is English.
Parameters
$langcode |
ISO 639-1 2-character language code (e.g. French is "fr")
|
$lang_path |
Path to the language file directory, with trailing separator (slash)
|
|
#
|
public
|
getTranslations(): array
Get the array of strings for the current language.
Get the array of strings for the current language.
|
#
|
public
|
addrAppend(string $type, array $addr): string
Create recipient headers.
Create recipient headers.
Parameters
$addr |
An array of recipient,
where each recipient is a 2-element indexed array with element 0 containing an address
and element 1 containing a name, like:
array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))
|
|
#
|
public
|
addrFormat(array $addr): string
Format an address for use in a message header.
Format an address for use in a message header.
Parameters
$addr |
A 2-element indexed array, element 0 containing an address, element 1 containing a name
like array('joe@example.com', 'Joe User')
|
|
#
|
public
|
wrapText(string $message, integer $length, boolean $qp_mode = false): string
Word-wrap message.
For use with mailers that do not automatically perform wrapping
and for quoted-printable encoded…
Word-wrap message.
For use with mailers that do not automatically perform wrapping
and for quoted-printable encoded messages.
Original written by philippe.
Parameters
$message |
The message to wrap
|
$length |
The line length to wrap to
|
$qp_mode |
Whether to run in Quoted-Printable mode
|
|
#
|
public
|
utf8CharBoundary(string $encodedText, integer $maxLength): integer
Find the last character boundary prior to $maxLength in a utf-8
quoted-printable encoded string.
Original written by…
Find the last character boundary prior to $maxLength in a utf-8
quoted-printable encoded string.
Original written by Colin Brown.
Parameters
$encodedText |
utf-8 QP text
|
$maxLength |
Find the last character boundary prior to this length
|
|
#
|
public
|
setWordWrap(): void
Apply word wrapping to the message body.
Wraps the message body to the number of chars set in the WordWrap property.…
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.
|
#
|
public
|
createHeader(): string
Assemble message headers.
Assemble message headers.
Returns
|
#
|
public
|
getMailMIME(): string
Get the message MIME type headers.
Get the message MIME type headers.
|
#
|
public
|
getSentMIMEMessage(): string
Returns the whole MIME message.
Includes complete headers and body.
Only valid post preSend().
Returns the whole MIME message.
Includes complete headers and body.
Only valid post preSend().
|
#
|
protected
|
generateId(): string
Create unique ID
|
#
|
public
|
createBody(): string
Assemble the message body.
Returns an empty string on failure.
Assemble the message body.
Returns an empty string on failure.
Returns
The assembled message body
Throws
|
#
|
protected
|
getBoundary(string $boundary, string $charSet, string $contentType, string $encoding): string
Return the start of a message boundary.
Return the start of a message boundary.
|
#
|
protected
|
endBoundary(string $boundary): string
Return the end of a message boundary.
Return the end of a message boundary.
|
#
|
protected
|
setMessageType(): void
Set the message type.
PHPMailer only supports some preset message types, not arbitrary MIME structures.
Set the message type.
PHPMailer only supports some preset message types, not arbitrary MIME structures.
|
#
|
public
|
headerLine(string $name, string $value): string
Format a header line.
|
#
|
public
|
textLine(string $value): string
Return a formatted mail line.
Return a formatted mail line.
|
#
|
public
|
addAttachment(
string $path,
string $name = '',
string $encoding = 'base64',
string $type = '',
string $disposition = 'attachment',
): boolean
Add an attachment from a path on the filesystem.
Never use a user-supplied path to a file!
Returns false if the file…
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.
Parameters
$path |
Path to the attachment.
|
$name |
Overrides the attachment name.
|
$encoding |
File encoding (see $Encoding).
|
$type |
File extension (MIME) type.
|
$disposition |
Disposition to use
|
Throws
|
#
|
public
|
getAttachments(): array
Return the array of attachments.
Return the array of attachments.
|
#
|
protected
|
attachAll(string $disposition_type, string $boundary): string
Attach all file, string, and binary attachments to the message.
Returns an empty string on failure.
Attach all file, string, and binary attachments to the message.
Returns an empty string on failure.
|
#
|
protected
|
encodeFile(string $path, string $encoding = 'base64'): string
Encode a file attachment in requested format.
Returns an empty string on failure.
Encode a file attachment in requested format.
Returns an empty string on failure.
Parameters
$path |
The full path to the file
|
$encoding |
The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
|
Throws
|
#
|
public
|
encodeString(string $str, string $encoding = 'base64'): string
Encode a string in requested format.
Returns an empty string on failure.
Encode a string in requested format.
Returns an empty string on failure.
Parameters
$str |
The text to encode
|
$encoding |
The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
|
|
#
|
public
|
encodeHeader(string $str, string $position = 'text'): string
Encode a header string optimally.
Picks shortest of Q, B, quoted-printable or none.
Encode a header string optimally.
Picks shortest of Q, B, quoted-printable or none.
|
#
|
public
|
hasMultiBytes(string $str): boolean
Check if a string contains multi-byte characters.
Check if a string contains multi-byte characters.
Parameters
$str |
multi-byte text to wrap encode
|
|
#
|
public
|
has8bitChars(string $text): boolean
Does a string contain any 8-bit chars (in any charset)?
Does a string contain any 8-bit chars (in any charset)?
|
#
|
public
|
base64EncodeWrapMB(string $str, string $linebreak = null): string
Encode and wrap long multibyte strings for mail headers
without breaking lines within a character.
Adapted from a…
Encode and wrap long multibyte strings for mail headers
without breaking lines within a character.
Adapted from a function by paravoid
Parameters
$str |
multi-byte text to wrap encode
|
$linebreak |
string to use as linefeed/end-of-line
|
|
#
|
public
|
encodeQP(string $string, integer $line_max = 76): string
Encode a string in quoted-printable format.
According to RFC2045 section 6.7.
Encode a string in quoted-printable format.
According to RFC2045 section 6.7.
Parameters
$string |
The text to encode
|
$line_max |
Number of chars allowed on a line before wrapping
|
|
#
|
public
|
encodeQPphp(string $string, integer $line_max = 76, boolean $space_conv = false): string
Backward compatibility wrapper for an old QP encoding function that was removed.
Backward compatibility wrapper for an old QP encoding function that was removed.
Deprecated
|
#
|
public
|
encodeQ(string $str, string $position = 'text'): string
Encode a string using Q encoding.
Encode a string using Q encoding.
Parameters
$str |
the text to encode
|
$position |
Where the text is going to be used, see the RFC for what that means
|
|
#
|
public
|
addStringAttachment(
string $string,
string $filename,
string $encoding = 'base64',
string $type = '',
string $disposition = 'attachment',
): void
Add a string or binary attachment (non-filesystem).
This method can be used to attach ascii or binary data,
such as a…
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.
Parameters
$string |
String attachment data.
|
$filename |
Name of the attachment.
|
$encoding |
File encoding (see $Encoding).
|
$type |
File extension (MIME) type.
|
$disposition |
Disposition to use
|
|
#
|
public
|
addEmbeddedImage(
string $path,
string $cid,
string $name = '',
string $encoding = 'base64',
string $type = '',
string $disposition = 'inline',
): boolean
Add an embedded (inline) attachment from a file.
This can include images, sounds, and just about any other document…
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!
Parameters
$path |
Path to the attachment.
|
$cid |
Content ID of the attachment; Use this to reference
the content when using an embedded image in HTML.
|
$name |
Overrides the attachment name.
|
$encoding |
File encoding (see $Encoding).
|
$type |
File MIME type.
|
$disposition |
Disposition to use
|
Returns
True on successfully adding an attachment
|
#
|
public
|
addStringEmbeddedImage(
string $string,
string $cid,
string $name = '',
string $encoding = 'base64',
string $type = '',
string $disposition = 'inline',
): boolean
Add an embedded stringified attachment.
This can include images, sounds, and just about any other document type.
Be…
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'.
Parameters
$string |
The attachment binary data.
|
$cid |
Content ID of the attachment; Use this to reference
the content when using an embedded image in HTML.
|
$encoding |
File encoding (see $Encoding).
|
$type |
MIME type.
|
$disposition |
Disposition to use
|
Returns
True on successfully adding an attachment
|
#
|
public
|
inlineImageExists(): boolean
Check if an inline attachment is present.
Check if an inline attachment is present.
|
#
|
public
|
attachmentExists(): boolean
Check if an attachment (non-inline) is present.
Check if an attachment (non-inline) is present.
|
#
|
public
|
alternativeExists(): boolean
Check if this message has an alternative body set.
Check if this message has an alternative body set.
|
#
|
public
|
clearQueuedAddresses(string $kind): void
Clear queued addresses of given kind.
Clear queued addresses of given kind.
Parameters
$kind |
'to', 'cc', or 'bcc'
|
|
#
|
public
|
clearAddresses(): void
Clear all To recipients.
|
#
|
public
|
clearCCs(): void
Clear all CC recipients.
|
#
|
public
|
clearBCCs(): void
Clear all BCC recipients.
Clear all BCC recipients.
|
#
|
public
|
clearReplyTos(): void
Clear all ReplyTo recipients.
Clear all ReplyTo recipients.
|
#
|
public
|
clearAllRecipients(): void
Clear all recipient types.
Clear all recipient types.
|
#
|
public
|
clearAttachments(): void
Clear all filesystem, string, and binary attachments.
Clear all filesystem, string, and binary attachments.
|
#
|
public
|
clearCustomHeaders(): void
Clear all custom headers.
Clear all custom headers.
|
#
|
protected
|
setError(string $msg): void
Add an error message to the error container.
Add an error message to the error container.
|
#
|
public
static
|
rfcDate(): string
Return an RFC 822 formatted date.
Return an RFC 822 formatted date.
|
#
|
protected
|
serverHostname(): string
Get the server hostname.
Returns 'localhost.localdomain' if unknown.
Get the server hostname.
Returns 'localhost.localdomain' if unknown.
|
#
|
protected
|
lang(string $key): string
Get an error message in the current language.
Get an error message in the current language.
|
#
|
public
|
isError(): boolean
Check if an error occurred.
Check if an error occurred.
Returns
True if an error did occur.
|
#
|
public
|
fixEOL(string $str): string
Ensure consistent line endings in a string.
Changes every end of line from CRLF, CR or LF to $this->LE.
Ensure consistent line endings in a string.
Changes every end of line from CRLF, CR or LF to $this->LE.
Parameters
|
#
|
public
|
addCustomHeader(string $name, string $value = null): void
Add a custom header.
$name value can be overloaded to contain
both header name and value (name:value)
Add a custom header.
$name value can be overloaded to contain
both header name and value (name:value)
Parameters
$name |
Custom header name
|
$value |
Header value
|
|
#
|
public
|
getCustomHeaders(): array
Returns all custom headers.
Returns all custom headers.
|
#
|
public
|
msgHTML(string $message, string $basedir = '', boolean|callable $advanced = false): string
Create a message body from an HTML string.
Automatically inlines images and creates a plain-text version by converting…
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. 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.
Parameters
$message |
HTML message string
|
$basedir |
Absolute path to a base directory to prepend to relative paths to images
|
$advanced |
Whether to use the internal HTML to text converter
or your own custom converter @see PHPMailer::html2text()
|
Returns
$message The transformed message Body
|
#
|
public
|
html2text(string $html, boolean|callable $advanced = false): string
Convert an HTML string into plain text.
This is used by msgHTML().
Note - older versions of this function used a…
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:
// 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();
});
Parameters
$html |
The HTML text to convert
|
$advanced |
Any boolean value to use the internal converter,
or provide your own callable for custom conversion.
|
|
#
|
public
static
|
_mime_types(string $ext = ''): string
Get the MIME type for a file extension.
Get the MIME type for a file extension.
Parameters
Returns
|
#
|
public
static
|
filenameToType(string $filename): string
Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
Parameters
$filename |
A file name or full path, does not need to exist as a file
|
|
#
|
public
static
|
mb_pathinfo(string $path, integer|string $options = null): string|array
Multi-byte-safe pathinfo replacement.
Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old…
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
Parameters
$path |
A filename or path, does not need to exist as a file
|
$options |
Either a PATHINFO_* constant,
or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
|
|
#
|
public
|
set(string $name, mixed $value = ''): boolean
Set or reset instance properties.
You should avoid this function - it's more verbose, less efficient, more error-prone…
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';
Parameters
$name |
The property name to set
|
$value |
The value to set the property to
|
|
#
|
public
|
secureHeader(string $str): string
Strip newlines to prevent header injection.
Strip newlines to prevent header injection.
|
#
|
public
static
|
normalizeBreaks(string $text, string $breaktype = "\r\n"): string
Normalize line breaks in a string.
Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break…
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.
Parameters
$breaktype |
What kind of line break to use, defaults to CRLF
|
|
#
|
public
|
sign(string $cert_filename, string $key_filename, string $key_pass, string $extracerts_filename = '')
Set the public and private key files and password for S/MIME signing.
Set the public and private key files and password for S/MIME signing.
Parameters
$key_pass |
Password for private key
|
$extracerts_filename |
Optional path to chain certificate
|
|
#
|
public
|
DKIM_QP(string $txt): string
Quoted-Printable-encode a DKIM header.
Quoted-Printable-encode a DKIM header.
|
#
|
public
|
DKIM_Sign(string $signHeader): string
Generate a DKIM signature.
Generate a DKIM signature.
Returns
Throws
|
#
|
public
|
DKIM_HeaderC(string $signHeader): string
Generate a DKIM canonicalization header.
Generate a DKIM canonicalization header.
Parameters
|
#
|
public
|
DKIM_BodyC(string $body): string
Generate a DKIM canonicalization body.
Generate a DKIM canonicalization body.
Parameters
|
#
|
public
|
DKIM_Add(string $headers_line, string $subject, string $body): string
Create the DKIM header and body in a new message header.
Create the DKIM header and body in a new message header.
Parameters
$headers_line |
Header lines
|
$subject |
Subject
|
$body |
Body
|
|
#
|
public
static
|
hasLineLongerThanMax(string $str): boolean
Detect if a string contains a line longer than the maximum line length allowed.
Detect if a string contains a line longer than the maximum line length allowed.
|
#
|
public
|
getToAddresses(): array
Allows for public read access to 'to' property.
Allows for public read access to 'to' property.
|
#
|
public
|
getCcAddresses(): array
Allows for public read access to 'cc' property.
Allows for public read access to 'cc' property.
|
#
|
public
|
getBccAddresses(): array
Allows for public read access to 'bcc' property.
Allows for public read access to 'bcc' property.
|
#
|
public
|
getReplyToAddresses(): array
Allows for public read access to 'ReplyTo' property.
Allows for public read access to 'ReplyTo' property.
|
#
|
public
|
getAllRecipientAddresses(): array
Allows for public read access to 'all_recipients' property.
Allows for public read access to 'all_recipients' property.
|
#
|
protected
|
doCallback(boolean $isSent, array $to, array $cc, array $bcc, string $subject, string $body, string $from)
Perform a callback.
|
#
|