Class PHPMailer

Description

PHP email creation and transport class

Located in /libraries/phpmailer/phpmailer.php (line 46)


	
			
Direct descendents
Class Description
 class JMail Email Class. Provides a common interface to send email from the Joomla! Platform
Class Constant Summary
Variable Summary
 string $AltBody
 array $attachment
 string $AuthType
 array $bcc
 string $Body
 array $boundary
 array $cc
 string $CharSet
 string $ContentType
 string $Debugoutput
 string $DKIM_domain
 string $DKIM_private
 bool $do_verp
 string $Encoding
 string $ErrorInfo
 integer $error_count
 boolean $exceptions
 string $From
 string $FromName
 string $Helo
 string $Host
 string $Hostname
 string $Ical
 array $language
 string $LE
 string $Mailer
 string $mailHeader
 string $MessageDate
 string $MessageID
 string $message_type
 string $MIMEBody
 string $MIMEHeader
 string $Password
 string $PluginDir
 int $Port
 int $Priority
 string $Realm
 array $ReplyTo
 string $ReturnPath
 string $Sender
 string $Sendmail
 bool $SingleTo
 bool $SMTPAuth
 bool $SMTPDebug
 string $SMTPSecure
 string $Subject
 int $Timeout
 array $to
 string $Username
 string $Version
 int $WordWrap
 string $Workstation
 string $XMailer
Method Summary
 static string filenameToType (string $filename)
 static string|array mb_pathinfo (string $path, [integer|string $options = null])
 static string NormalizeBreaks (string $text, [string $breaktype = "\r\n"])
 static string RFCDate ()
 static boolean ValidateAddress (string $address)
 static string _mime_types ([string $ext = ''])
 PHPMailer __construct ([boolean $exceptions = false])
 void __destruct ()
 boolean AddAddress (string $address, [string $name = ''])
 boolean AddAnAddress (string $kind, string $address, [string $name = ''])
 bool AddAttachment (string $path, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
 boolean AddBCC (string $address, [string $name = ''])
 boolean AddCC (string $address, [string $name = ''])
 void AddCustomHeader (string $name, [string $value = null])
 bool AddEmbeddedImage (string $path, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
 string AddrAppend (string $type, array $addr)
 boolean AddReplyTo (string $address, [string $name = ''])
 string AddrFormat (string $addr)
 void AddStringAttachment (string $string, string $filename, [string $encoding = 'base64'], [string $type = ''])
 bool AddStringEmbeddedImage (string $string, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
 string AttachAll (string $disposition_type, string $boundary)
 string Base64EncodeWrapMB (string $str, [string $lf = null])
 void ClearAddresses ()
 void ClearBCCs ()
 void ClearCCs ()
 void ClearReplyTos ()
 string CreateBody ()
 string CreateHeader ()
 string DKIM_Add (string $headers_line, string $subject, string $body)
 string DKIM_BodyC (string $body)
 string DKIM_HeaderC (string $s)
 string DKIM_QP (string $txt)
 string DKIM_Sign (string $s)
 void doCallback (boolean $isSent, string $to, string $cc, string $bcc, string $subject, string $body, [string $from = null])
 void edebug (string $str)
 string EncodeFile (string $path, [string $encoding = 'base64'])
 string EncodeHeader (string $str, [string $position = 'text'])
 string EncodeQ (string $str, [string $position = 'text'])
 string EncodeQP (string $string, [integer $line_max = 76])
 string EncodeQPphp (string $string, [integer $line_max = 76], [bool $space_conv = false])
 string EncodeString (string $str, [string $encoding = 'base64'])
 string EndBoundary (string $boundary)
 string FixEOL (string $str)
 array GetAttachments ()
 string GetBoundary (string $boundary, string $charSet, string $contentType, string $encoding)
 string GetMailMIME ()
 string GetSentMIMEMessage ()
 array GetTranslations ()
 bool HasMultiBytes (string $str)
 string HeaderLine (string $name, string $value)
 string html2text (string $html, [bool $advanced = false])
 bool IsError ()
 void IsHTML ([bool $ishtml = true])
 void IsMail ()
 void IsQmail ()
 void IsSendmail ()
 void IsSMTP ()
 string Lang (string $key)
 bool MailSend (string $header, string $body)
 string MsgHTML (string $message, [string $basedir = ''], [bool $advanced = false])
 bool PostSend ()
 bool PreSend ()
 string SecureHeader (string $str)
 bool Send ()
 bool SendmailSend (string $header, string $body)
 string ServerHostname ()
 bool set (string $name, [mixed $value = ''])
 void SetError (string $msg)
 boolean SetFrom (string $address, [string $name = ''], [boolean $auto = true])
 bool SetLanguage ([string $langcode = 'en'], [string $lang_path = 'language/'])
 void SetMessageType ()
 void SetWordWrap ()
 void Sign (string $cert_filename, string $key_filename, string $key_pass)
 void SmtpClose ()
 bool SmtpConnect ([array $options = array()])
 bool SmtpSend (string $header, string $body)
 string TextLine (string $value)
 int UTF8CharBoundary (string $encodedText, int $maxLength)
 string WrapText (string $message, integer $length, [boolean $qp_mode = false])
Variables
string $action_function = '' (line 413)

Callback Action function name.

The function that handles the result of the send email action. It is called out by Send() for each email sent.

Value can be:

  • 'function_name' for function names
  • 'Class::Method' for static method calls
  • array($object, 'Method') for calling methods on $object
See http://php.net/is_callable manual page for more details.

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 string $from email address of sender

  • access: public
bool $AllowEmpty = false (line 345)

Should we allow sending messages with empty body?

  • access: public
array $all_recipients = array() (line 460)
  • var: An array of all kinds of addresses: to, cc, bcc, replyto
  • access: protected
string $AltBody = '' (line 129)

The plain-text message body.

This body can be read by mail clients that do not have HTML email capability such as mutt & Eudora. Clients that can read HTML will view the normal Body.

  • access: public
array $attachment = array() (line 465)
  • var: An array of attachments
  • access: protected
string $AuthType = '' (line 279)

Sets SMTP auth type. Options are LOGIN | PLAIN | NTLM | CRAM-MD5 (default LOGIN)

  • access: public
array $bcc = array() (line 450)
  • var: An array of 'bcc' addresses
  • access: protected
string $Body = '' (line 120)

An HTML or plain text message body.

If HTML then call IsHTML(true).

  • access: public
array $boundary = array() (line 480)
  • var: An array of MIME boundary strings
  • access: protected
array $cc = array() (line 445)
  • var: An array of 'cc' addresses
  • access: protected
string $CharSet = 'iso-8859-1' (line 62)

Sets the CharSet of the message.

  • access: public

Redefined in descendants as:
string $ConfirmReadingTo = '' (line 199)

Sets the email address that a reading confirmation will be sent.

  • access: public
string $ContentType = 'text/plain' (line 68)

Sets the Content-type of the message.

  • access: public
array $CustomHeader = array() (line 470)
  • var: An array of custom headers
  • access: protected
string $Debugoutput = "echo" (line 311)

Sets the function/method to use for debugging output.

Right now we only honor "echo" or "error_log"

  • access: public
string $DKIM_domain = '' (line 383)

Used with DKIM Singing

required if DKIM is enabled, in format of email address 'domain.com'

  • access: public
string $DKIM_identity = '' (line 369)

Used with DKIM Signing

required if DKIM is enabled, in format of email address 'you@yourdomain.com' typically used as the source of the email

  • access: public
string $DKIM_passphrase = '' (line 376)

Used with DKIM Signing

optional parameter if your private key requires a passphras

  • access: public
string $DKIM_private = '' (line 390)

Used with DKIM Signing

required if DKIM is enabled, path to private key file

  • access: public
string $DKIM_selector = '' (line 362)

Used with DKIM Signing required parameter if DKIM is enabled

domain selector example domainkey

  • access: public
bool $do_verp = false (line 333)

Should we generate VERP addresses when sending via SMTP?

string $Encoding = '8bit' (line 75)

Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".

  • access: public
string $ErrorInfo = '' (line 81)

Holds the most recent mailer error message.

  • access: public
integer $error_count = 0 (line 490)
  • var: The number of errors encountered
  • access: protected
boolean $exceptions = false (line 510)
  • var: Whether to throw exceptions for errors
  • access: protected
string $From = 'root@localhost' (line 87)

Sets the From email address for the message.

  • access: public
string $FromName = 'Root User' (line 93)

Sets the From name of the message.

  • access: public
string $Helo = '' (line 249)

Sets the SMTP HELO of the message (Default is $Hostname).

  • access: public
string $Host = 'localhost' (line 237)

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"). Hosts will be tried in order.

  • access: public
string $Hostname = '' (line 207)

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'.

  • access: public
string $Ical = '' (line 139)

An iCal message part body

Only supported in simple alt or alt_inline message types To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator

array $language = array() (line 485)
  • var: An array of available languages
  • access: protected
string $LE = "\n" (line 353)

Provides the ability to change the generic line ending

NOTE: The default remains '\n'. We force CRLF where we KNOW it must be used via self::CRLF

  • access: public
string $Mailer = 'mail' (line 173)

Method to send mail: ("mail", "sendmail", or "smtp").

  • access: public
string $mailHeader = '' (line 160)

Stores the extra header list which CreateHeader() doesn't fold in

  • access: protected
string $MessageDate = '' (line 221)

Sets the message Date to be used in the Date header.

If empty, the current date will be added.

  • access: public
string $MessageID = '' (line 214)

Sets the message ID to be used in the Message-Id header.

If empty, a unique id will be generated.

  • access: public
string $message_type = '' (line 475)
  • var: The message's MIME type
  • access: protected
string $MIMEBody = '' (line 146)

Stores the complete compiled MIME message body.

  • access: protected
string $MIMEHeader = '' (line 153)

Stores the complete compiled MIME message headers.

  • access: protected
string $Password = '' (line 273)

Sets SMTP password.

  • access: public
string $PluginDir = '' (line 193)

Path to PHPMailer plugins. Useful if the SMTP class is in a different directory than the PHP include path.

  • access: public
int $Port = 25 (line 243)

Sets the default SMTP server port.

  • access: public
int $Priority = 3 (line 56)

Email priority (1 = High, 3 = Normal, 5 = low).

  • access: public
string $Realm = '' (line 285)

Sets SMTP realm.

  • access: public
array $ReplyTo = array() (line 455)
  • var: An array of reply-to name and address
  • access: protected
string $ReturnPath = '' (line 107)

Sets the Return-Path of the message. If empty, it will be set to either From or Sender.

  • access: public
string $Sender = '' (line 100)

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.

  • access: public
string $Sendmail = '/usr/sbin/sendmail' (line 179)

Sets the path of the sendmail program.

  • access: public
string $sign_cert_file = '' (line 495)
  • var: The filename of a DKIM certificate file
  • access: protected
string $sign_key_file = '' (line 500)
  • var: The filename of a DKIM key file
  • access: protected
string $sign_key_pass = '' (line 505)
  • var: The password of a DKIM key
  • access: protected
bool $SingleTo = false (line 326)

Provides the ability to have the TO field process individual

emails, instead of sending to entire TO addresses

  • access: public
bool $SingleToArray = array() (line 339)

If SingleTo is true, this provides the array to hold the email addresses

  • access: public
SMTP $smtp = null (line 435)
  • var: An instance of the SMTP sender class
  • access: protected
bool $SMTPAuth = false (line 261)

Sets SMTP authentication. Utilizes the Username and Password variables.

  • access: public
bool $SMTPDebug = false (line 304)

Sets SMTP class debugging on or off.

  • access: public
bool $SMTPKeepAlive = false (line 319)

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().

  • access: public
string $SMTPSecure = '' (line 255)

Sets connection prefix. Options are "", "ssl" or "tls"

  • access: public
string $Subject = '' (line 113)

Sets the Subject of the message.

  • access: public
int $Timeout = 10 (line 298)

Sets the SMTP server timeout in seconds.

This function will not work with the win32 version.

  • access: public
array $to = array() (line 440)
  • var: An array of 'to' addresses
  • access: protected
string $Username = '' (line 267)

Sets SMTP username.

  • access: public
boolean $UseSendmailOptions = true (line 186)

Determine if mail() uses a fully sendmail compatible MTA that

supports sendmail's "-oi -f" options

  • access: public
string $Version = '5.2.6' (line 419)

Sets the PHPMailer Version number

  • access: public
int $WordWrap = 0 (line 167)

Sets word wrapping on the body of the message to a given number of characters.

  • access: public
string $Workstation = '' (line 291)

Sets SMTP workstation.

  • access: public
string $XMailer = '' (line 425)

What to use in the X-Mailer header

  • var: NULL for default, whitespace for None, or actual string to use
  • access: public
Methods
static filenameToType (line 2654)

Try to map a file name to a MIME type, default to application/octet-stream

  • access: public
static string filenameToType (string $filename)
  • string $filename: A file name or full path, does not need to exist as a file
static mb_pathinfo (line 2673)

Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe.

Works similarly to the one in PHP >= 5.2.0

static string|array mb_pathinfo (string $path, [integer|string $options = null])
  • string $path: A filename or path, does not need to exist as a file
  • integer|string $options: Either a PATHINFO_* constant, or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
static NormalizeBreaks (line 2760)

Normalize 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

  • access: public
static string NormalizeBreaks (string $text, [string $breaktype = "\r\n"])
  • string $text
  • string $breaktype: What kind of line break to use, defaults to CRLF
static RFCDate (line 2404)

Returns the proper RFC 822 formatted date.

  • access: public
static string RFCDate ()
static ValidateAddress (line 773)

Check that a string looks roughly like an email address should

Static so it can be used without instantiation, public so people can overload Conforms to RFC5322: Uses *correct* regex on which FILTER_VALIDATE_EMAIL is based; So why not use FILTER_VALIDATE_EMAIL? Because it was broken to not allow a@b type valid addresses :(

static boolean ValidateAddress (string $address)
  • string $address: The email address to check
static _mime_types (line 2556)

Gets the MIME type of the embedded or inline image

  • return: MIME type of ext
  • access: public
static string _mime_types ([string $ext = ''])
  • string $ext: File extension
Constructor __construct (line 571)

Constructor

  • access: public
PHPMailer __construct ([boolean $exceptions = false])
  • boolean $exceptions: Should we throw external exceptions?

Redefined in descendants as:
Destructor __destruct (line 578)

Destructor

  • access: public
void __destruct ()
AddAddress (line 645)

Adds a "To" address.

  • return: true on success, false if address already used
  • access: public
boolean AddAddress (string $address, [string $name = ''])
  • string $address
  • string $name
AddAnAddress (line 691)

Adds an address to one of the recipient arrays

Addresses that have been added already return false, but do not throw exceptions

  • return: true on success, false if address already used or invalid in some way
  • throws: phpmailerException
  • access: protected
boolean AddAnAddress (string $kind, string $address, [string $name = ''])
  • string $kind: One of 'to', 'cc', 'bcc', 'ReplyTo'
  • string $address: The email address to send to
  • string $name
AddAttachment (line 1774)

Adds an attachment from a path on the filesystem.

Returns false if the file could not be found or accessed.

  • throws: phpmailerException
  • access: public
bool AddAttachment (string $path, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
  • string $path: Path to the attachment.
  • string $name: Overrides the attachment name.
  • string $encoding: File encoding (see $Encoding).
  • string $type: File extension (MIME) type.
AddBCC (line 667)

Adds a "Bcc" address.

Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

  • return: true on success, false if address already used
  • access: public
boolean AddBCC (string $address, [string $name = ''])
  • string $address
  • string $name
AddCC (line 656)

Adds a "Cc" address.

Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

  • return: true on success, false if address already used
  • access: public
boolean AddCC (string $address, [string $name = ''])
  • string $address
  • string $name
AddCustomHeader (line 2479)

Adds a custom header. $name value can be overloaded to contain

both header name and value (name:value)

  • access: public
void AddCustomHeader (string $name, [string $value = null])
  • string $name: custom header name
  • string $value: header value
AddEmbeddedImage (line 2204)

Add an embedded attachment from a file.

This can include images, sounds, and just about any other document type.

  • return: True on successfully adding an attachment
  • access: public
bool AddEmbeddedImage (string $path, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
  • string $path: Path to the attachment.
  • string $cid: Content ID of the attachment; Use this to reference the content when using an embedded image in HTML.
  • string $name: Overrides the attachment name.
  • string $encoding: File encoding (see $Encoding).
  • string $type: File MIME type.
AddrAppend (line 1217)

Creates recipient headers.

  • access: public
string AddrAppend (string $type, array $addr)
  • string $type
  • array $addr
AddReplyTo (line 677)

Adds a "Reply-to" address.

  • access: public
boolean AddReplyTo (string $address, [string $name = ''])
  • string $address
  • string $name
AddrFormat (line 1235)

Formats an address correctly.

  • access: public
string AddrFormat (string $addr)
  • string $addr
AddStringAttachment (line 2175)

Adds a string or binary attachment (non-filesystem) to the list.

This method can be used to attach ascii or binary data, such as a BLOB record from a database.

  • access: public
void AddStringAttachment (string $string, string $filename, [string $encoding = 'base64'], [string $type = ''])
  • string $string: String attachment data.
  • string $filename: Name of the attachment.
  • string $encoding: File encoding (see $Encoding).
  • string $type: File extension (MIME) type.
AddStringEmbeddedImage (line 2248)

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'.

  • return: True on successfully adding an attachment
  • access: public
bool AddStringEmbeddedImage (string $string, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = ''])
  • string $string: The attachment binary data.
  • string $cid: Content ID of the attachment; Use this to reference the content when using an embedded image in HTML.
  • string $name
  • string $encoding: File encoding (see $Encoding).
  • string $type: MIME type.
AlternativeExists (line 2299)

Does this message have an alternative body set?

  • access: public
bool AlternativeExists ()
AttachAll (line 1830)

Attaches all fs, string, and binary attachments to the message.

Returns an empty string on failure.

  • access: protected
string AttachAll (string $disposition_type, string $boundary)
  • string $disposition_type
  • string $boundary
AttachmentExists (line 2286)

Returns true if an attachment (non-inline) is present.

  • access: public
bool AttachmentExists ()
Base64EncodeWrapMB (line 2058)

Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character.

Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php

  • access: public
string Base64EncodeWrapMB (string $str, [string $lf = null])
  • string $str: multi-byte text to wrap encode
  • string $lf: string to use as linefeed/end-of-line
ClearAddresses (line 2311)

Clears all recipients assigned in the TO array. Returns void.

  • access: public
void ClearAddresses ()
ClearAllRecipients (line 2353)

Clears all recipients assigned in the TO, CC and BCC array. Returns void.

  • access: public
void ClearAllRecipients ()
ClearAttachments (line 2365)

Clears all previously set filesystem, string, and binary attachments. Returns void.

  • access: public
void ClearAttachments ()
ClearBCCs (line 2333)

Clears all recipients assigned in the BCC array. Returns void.

  • access: public
void ClearBCCs ()
ClearCCs (line 2322)

Clears all recipients assigned in the CC array. Returns void.

  • access: public
void ClearCCs ()
ClearCustomHeaders (line 2373)

Clears all custom headers. Returns void.

  • access: public
void ClearCustomHeaders ()
ClearReplyTos (line 2344)

Clears all recipients assigned in the ReplyTo array. Returns void.

  • access: public
void ClearReplyTos ()
CreateBody (line 1551)

Assembles the message body. Returns an empty string on failure.

  • return: The assembled message body
  • throws: phpmailerException
  • access: public
string CreateBody ()
CreateHeader (line 1401)

Assembles message header.

  • return: The assembled header
  • access: public
string CreateHeader ()
DKIM_Add (line 2874)

Create the DKIM header, body, as new header

  • access: public
string DKIM_Add (string $headers_line, string $subject, string $body)
  • string $headers_line: Header lines
  • string $subject: Subject
  • string $body: Body
DKIM_BodyC (line 2853)

Generate DKIM Canonicalization Body

  • access: public
string DKIM_BodyC (string $body)
  • string $body: Message Body
DKIM_HeaderC (line 2833)

Generate DKIM Canonicalization Header

  • access: public
string DKIM_HeaderC (string $s)
  • string $s: Header
DKIM_QP (line 2786)

Set the private key file and password to sign the message.

  • access: public
string DKIM_QP (string $txt)
  • string $txt
DKIM_Sign (line 2807)

Generate DKIM signature

  • throws: phpmailerException
  • access: public
string DKIM_Sign (string $s)
  • string $s: Header
doCallback (line 2930)

Perform callback

  • access: protected
void doCallback (boolean $isSent, string $to, string $cc, string $bcc, string $subject, string $body, [string $from = null])
  • boolean $isSent
  • string $to
  • string $cc
  • string $bcc
  • string $subject
  • string $body
  • string $from
edebug (line 551)

Outputs debugging info via user-defined method

  • access: protected
void edebug (string $str)
  • string $str
EncodeFile (line 1910)

Encodes attachment in requested format.

Returns an empty string on failure.

string EncodeFile (string $path, [string $encoding = 'base64'])
  • string $path: The full path to the file
  • string $encoding: The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
EncodeHeader (line 1980)

Encode a header string to best (shortest) of Q, B, quoted or none.

  • access: public
string EncodeHeader (string $str, [string $position = 'text'])
  • string $str
  • string $position
EncodeQ (line 2132)

Encode string to q encoding.

string EncodeQ (string $str, [string $position = 'text'])
  • string $str: the text to encode
  • string $position: Where the text is going to be used, see the RFC for what that means
EncodeQP (line 2101)

Encode string to RFC2045 (6.7) quoted-printable format

  • link: PHP
  • access: public
string EncodeQP (string $string, [integer $line_max = 76])
  • string $string: The text to encode
  • integer $line_max: Number of chars allowed on a line before wrapping
EncodeQPphp (line 2120)

Wrapper to preserve BC for old QP encoding function that was removed

string EncodeQPphp (string $string, [integer $line_max = 76], [bool $space_conv = false])
  • string $string
  • integer $line_max
  • bool $space_conv
EncodeString (line 1947)

Encodes string to requested format.

Returns an empty string on failure.

  • access: public
string EncodeString (string $str, [string $encoding = 'base64'])
  • string $str: The text to encode
  • string $encoding: The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
EndBoundary (line 1720)

Returns the end of a message boundary.

  • access: protected
string EndBoundary (string $boundary)
  • string $boundary
FixEOL (line 2461)

Changes every end of line from CRLF, CR or LF to $this->LE.

  • access: public
string FixEOL (string $str)
  • string $str: String to FixEOL
GetAttachments (line 1818)

Return the current array of attachments

  • access: public
array GetAttachments ()
GetBoundary (line 1694)

Returns the start of a message boundary.

  • access: protected
string GetBoundary (string $boundary, string $charSet, string $contentType, string $encoding)
  • string $boundary
  • string $charSet
  • string $contentType
  • string $encoding
GetMailMIME (line 1499)

Returns the message MIME.

  • access: public
string GetMailMIME ()
GetSentMIMEMessage (line 1540)

Returns the MIME message (headers and body). Only really valid post PreSend().

  • access: public
string GetSentMIMEMessage ()
GetTranslations (line 1202)

Return the current array of language strings

  • access: public
array GetTranslations ()
HasMultiBytes (line 2041)

Checks if a string contains multibyte characters.

  • access: public
bool HasMultiBytes (string $str)
  • string $str: multi-byte text to wrap encode
HeaderLine (line 1745)

Returns a formatted header line.

  • access: public
string HeaderLine (string $name, string $value)
  • string $name
  • string $value
html2text (line 2538)

Convert an HTML string into a plain text version

  • access: public
string html2text (string $html, [bool $advanced = false])
  • string $html: The HTML text to convert
  • bool $advanced: Should this use the more complex html2text converter or just a simple one?
InlineImageExists (line 2273)

Returns true if an inline attachment is present.

  • access: public
bool InlineImageExists ()
IsError (line 2451)

Returns true if an error occurred.

  • access: public
bool IsError ()
IsHTML (line 589)

Sets message type to HTML.

  • access: public
void IsHTML ([bool $ishtml = true])
  • bool $ishtml
IsMail (line 609)

Sets Mailer to send message using PHP mail() function.

  • access: public
void IsMail ()
IsQmail (line 628)

Sets Mailer to send message using the qmail MTA.

  • access: public
void IsQmail ()
IsSendmail (line 617)

Sets Mailer to send message using the $Sendmail program.

  • access: public
void IsSendmail ()
IsSMTP (line 601)

Sets Mailer to send message using SMTP.

  • access: public
void IsSMTP ()
Lang (line 2434)

Returns a message in the appropriate language.

  • access: protected
string Lang (string $key)
  • string $key
MailSend (line 954)

Sends mail using the PHP mail() function.

  • throws: phpmailerException
  • access: protected
bool MailSend (string $header, string $body)
  • string $header: The message headers
  • string $body: The message body
MsgHTML (line 2498)

Creates a message from an HTML string, making modifications for inline images and backgrounds

and creates a plain-text version by converting the HTML Overwrites any existing values in $this->Body and $this->AltBody

  • access: public
string MsgHTML (string $message, [string $basedir = ''], [bool $advanced = false])
  • string $message: HTML message string
  • string $basedir: baseline directory for path
  • bool $advanced: Whether to use the advanced HTML to text converter
PostSend (line 874)

Actual Email transport function

Send the email via the selected mechanism

  • throws: phpmailerException
  • access: public
bool PostSend ()
PreSend (line 818)

Prep mail by constructing all message entities

  • throws: phpmailerException
  • access: public
bool PreSend ()
SecureHeader (line 2747)

Strips newlines to prevent header injection.

  • access: public
string SecureHeader (string $str)
  • string $str
Send (line 799)

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.

  • throws: phpmailerException
  • access: public
bool Send ()

Redefined in descendants as:
SendmailSend (line 907)

Sends mail using the $Sendmail program.

  • throws: phpmailerException
  • access: protected
bool SendmailSend (string $header, string $body)
  • string $header: The message headers
  • string $body: The message body
ServerHostname (line 2416)

Returns the server hostname or 'localhost.localdomain' if unknown.

  • access: protected
string ServerHostname ()
set (line 2725)

Set (or reset) Class Objects (variables)

Usage Example: $page->set('X-Priority', '3');

  • todo: Should this not be using __set() magic function?
  • throws: phpmailerException
  • access: public
bool set (string $name, [mixed $value = ''])
  • string $name
  • mixed $value: NOTE: will not work with arrays, there are no arrays to set/reset
SetError (line 2387)

Adds the error message to the error container.

  • access: protected
void SetError (string $msg)
  • string $msg
SetFrom (line 737)

Set the From and FromName properties

  • throws: phpmailerException
  • access: public
boolean SetFrom (string $address, [string $name = ''], [boolean $auto = true])
  • string $address
  • string $name
  • boolean $auto: Whether to also set the Sender address, defaults to true
SetLanguage (line 1167)

Sets the language for all class error messages.

Returns false if it cannot load the language file. The default language is English.

  • access: public
bool SetLanguage ([string $langcode = 'en'], [string $lang_path = 'language/'])
  • string $langcode: ISO 639-1 2-character language code (e.g. Portuguese: "br")
  • string $lang_path: Path to the language file directory
SetMessageType (line 1729)

Sets the message type.

  • access: protected
void SetMessageType ()
SetWordWrap (line 1378)

Set the body wrapping.

  • access: public
void SetWordWrap ()
Sign (line 2773)

Set the private key file and password to sign the message.

  • access: public
void Sign (string $cert_filename, string $key_filename, string $key_pass)
  • string $cert_filename
  • string $key_filename
  • string $key_pass: Password for private key
SmtpClose (line 1150)

Closes the active SMTP session if one exists.

  • access: public
void SmtpClose ()
SmtpConnect (line 1080)

Initiates a connection to an SMTP server.

Returns false if the operation failed.

  • throws: phpmailerException
  • access: public
  • uses: SMTP
bool SmtpConnect ([array $options = array()])
  • array $options: An array of options compatible with stream_context_create()
SmtpSend (line 1003)

Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input.

  • throws: phpmailerException
  • access: protected
  • uses: SMTP
bool SmtpSend (string $header, string $body)
  • string $header: The message headers
  • string $body: The message body
TextLine (line 1755)

Returns a formatted mail line.

  • access: public
string TextLine (string $value)
  • string $value
UTF8CharBoundary (line 1340)

Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.

Original written by Colin Brown.

  • access: public
int UTF8CharBoundary (string $encodedText, int $maxLength)
  • string $encodedText: utf-8 QP text
  • int $maxLength: find last character boundary prior to this length
WrapText (line 1253)

Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.

Original written by philippe.

  • access: public
string WrapText (string $message, integer $length, [boolean $qp_mode = false])
  • string $message: The message to wrap
  • integer $length: The line length to wrap to
  • boolean $qp_mode: Whether to run in Quoted-Printable mode
Class Constants
CRLF = "\r\n" (line 519)
STOP_CONTINUE = 1 (line 517)
STOP_CRITICAL = 2 (line 518)
STOP_MESSAGE = 0 (line 516)

Documentation generated on Tue, 19 Nov 2013 15:10:38 +0100 by phpDocumentor 1.4.3