class PHPMailer {
  • // constants
  • const STOP_MESSAGE = 0;
  • const STOP_CONTINUE = 1;
  • const STOP_CRITICAL = 2;


Line Task
2146+ Should this not be using __set() magic function?


Name Value



  • $CustomHeader
  • $ReplyTo
  • $all_recipients
  • $attachment
  • $bcc
  • $boundary
  • $cc
  • $error_count
  • $exceptions
  • $message_type
  • $sign_cert_file
  • $sign_key_file
  • $sign_key_pass
  • $smtp
  • $to


  • $language


  • $AltBody — string
    Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.
  • $Body — string
    Sets the Body of the message. This can be either an HTML or text body.
  • $CharSet — string
    Sets the CharSet of the message.
  • $ConfirmReadingTo — string
    Sets the email address that a reading confirmation will be sent.
  • $ContentType — string
    Sets the Content-type of the message.
  • $DKIM_domain — string
    Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com'
  • $DKIM_identity — string
    Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com'
  • $DKIM_private — string
    Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com'
  • $DKIM_selector — string
    Used with DKIM DNS Resource Record
  • $Encoding — string
    Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
  • $ErrorInfo — string
    Holds the most recent mailer error message.
  • $From — string
    Sets the From email address for the message.
  • $FromName — string
    Sets the From name of the message.
  • $Helo — string
    Sets the SMTP HELO of the message (Default is $Hostname).
  • $Host — string
    Sets the SMTP hosts. All hosts must be separated by a semicolon. 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").
  • $Hostname — string
    Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.
  • $LE — string
    Provides the ability to change the line ending
  • $Mailer — string
    Method to send mail: ("mail", "sendmail", or "smtp").
  • $MessageID — string
    Sets the message ID to be used in the Message-Id header.
  • $Password — string
    Sets SMTP password.
  • $PluginDir — string
    Path to PHPMailer plugins. Useful if the SMTP class is in a different directory than the PHP include path.
  • $Port — int
    Sets the default SMTP server port.
  • $Priority — int
    Email priority (1 = High, 3 = Normal, 5 = low).
  • $SMTPAuthbool
    Sets SMTP authentication. Utilizes the Username and Password variables.
  • $SMTPDebugbool
    Sets SMTP class debugging on or off.
  • $SMTPKeepAlivebool
    Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
  • $SMTPSecure — string
    Sets connection prefix.
  • $Sender — string
    Sets 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.
  • $Sendmail — string
    Sets the path of the sendmail program.
  • $SingleTobool
    Provides the ability to have the TO field process individual emails, instead of sending to entire TO addresses
  • $SingleToArraybool
    If SingleTo is true, this provides the array to hold the email addresses
  • $Subject — string
    Sets the Subject of the message.
  • $Timeout — int
    Sets the SMTP server timeout in seconds.
  • $Username — string
    Sets SMTP username.
  • $Version — string
    Sets the PHPMailer Version number
  • $WordWrap — int
    Sets word wrapping on the body of the message to a given number of characters.
  • $action_function — string
    Callback Action function name the function that handles the result of the send email action. Parameters: bool $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



  • AddAnAddress() — Adds an address to one of the recipient arrays Addresses that have been added already return false, but do not throw exceptions
  • AttachAll() — Attaches all fs, string, and binary attachments to the message.
  • EncodeFile() — Encodes attachment in requested format.
  • EndBoundary() — Returns the end of a message boundary.
  • FixEOL() — Changes every end of line from CR or LF to CRLF.
  • GetBoundary() — Returns the start of a message boundary.
  • Lang() — Returns a message in the appropriate language.
  • ServerHostname() — Returns the server hostname or 'localhost.localdomain' if unknown.
  • SetMessageType() — Sets the message type.


  • MailSend() — Sends mail using the PHP mail() function.
  • SendmailSend() — Sends mail using the $Sendmail program.
  • SetError() — Adds the error message to the error container.
  • SmtpSend() — Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
  • doCallback()


  • __construct() — Constructor
  • AddAddress() — Adds a "To" address.
  • AddAttachment() — Adds an attachment from a path on the filesystem.
  • AddBCC() — Adds a "Bcc" address.
  • AddCC() — Adds a "Cc" address.
  • AddCustomHeader() — Adds a custom header.
  • AddEmbeddedImage() — Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
  • AddReplyTo() — Adds a "Reply-to" address.
  • AddStringAttachment() — Adds a string or binary attachment (non-filesystem) to the list.
  • AddrAppend() — Creates recipient headers.
  • AddrFormat() — Formats an address correctly.
  • Base64EncodeWrapMB() — Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character.
  • ClearAddresses() — Clears all recipients assigned in the TO array. Returns void.
  • ClearAllRecipients() — Clears all recipients assigned in the TO, CC and BCC array. Returns void.
  • ClearAttachments() — Clears all previously set filesystem, string, and binary attachments. Returns void.
  • ClearBCCs() — Clears all recipients assigned in the BCC array. Returns void.
  • ClearCCs() — Clears all recipients assigned in the CC array. Returns void.
  • ClearCustomHeaders() — Clears all custom headers. Returns void.
  • ClearReplyTos() — Clears all recipients assigned in the ReplyTo array. Returns void.
  • CreateBody() — Assembles the message body. Returns an empty string on failure.
  • CreateHeader() — Assembles message header.
  • DKIM_Add() — Create the DKIM header, body, as new header
  • DKIM_BodyC() — Generate DKIM Canonicalization Body
  • DKIM_HeaderC() — Generate DKIM Canonicalization Header
  • DKIM_QP() — Set the private key file and password to sign the message.
  • DKIM_Sign() — Generate DKIM signature
  • EncodeHeader() — Encode a header string to best (shortest) of Q, B, quoted or none.
  • EncodeQ() — Encode string to q encoding.
  • EncodeQP() — Encode string to RFC2045 (6.7) quoted-printable format Uses a PHP5 stream filter to do the encoding about 64x faster than the old version Also results in same content as you started with after decoding
  • EncodeQPphp() — Encode string to quoted-printable.
  • EncodeString() — Encodes string to requested format.
  • GetAttachments() — Return the current array of attachments
  • GetMailMIME() — Returns the message MIME.
  • GetTranslations() — Return the current array of language strings
  • HasMultiBytes() — Checks if a string contains multibyte characters.
  • HeaderLine() — Returns a formatted header line.
  • InlineImageExists() — Returns true if an inline attachment is present.
  • IsError() — Returns true if an error occurred.
  • IsHTML() — Sets message type to HTML.
  • IsMail() — Sets Mailer to send message using PHP mail() function.
  • IsQmail() — Sets Mailer to send message using the qmail MTA.
  • IsSMTP() — Sets Mailer to send message using SMTP.
  • IsSendmail() — Sets Mailer to send message using the $Sendmail program.
  • MsgHTML() — Evaluates the message and returns modifications for inline images and backgrounds
  • RFCDate() — Returns the proper RFC 822 formatted date.
  • SecureHeader() — Strips newlines to prevent header injection.
  • Send() — Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
  • SetFrom() — Set the From and FromName properties
  • SetLanguage() — Sets the language for all class error messages.
  • SetWordWrap() — Set the body wrapping.
  • Sign() — Set the private key file and password to sign the message.
  • SmtpClose() — Closes the active SMTP session if one exists.
  • SmtpConnect() — Initiates a connection to an SMTP server.
  • TextLine() — Returns a formatted mail line.
  • UTF8CharBoundary() — Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.
  • ValidateAddress() — Check that a string looks roughly like an email address should Static so it can be used without instantiation Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator Conforms approximately to RFC2822
  • WrapText() — Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
  • _mime_types() — Gets the MIME type of the embedded or inline image
  • set() — Set (or reset) Class Objects (variables)