Class PHPMailer
Copyright: 2004 - 2009 Andy Prevost
License: GNU Lesser General Public License
Author: Andy Prevost
Author: Marcus Bointon
Located at vendors/phpmailer/class.phpmailer.php
Methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
boolean
|
|
public
boolean
|
#
AddCC( string $address, string $name = '' )
Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. |
public
boolean
|
#
AddBCC( string $address, string $name = '' )
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. |
public
boolean
|
|
private
boolean
|
#
AddAnAddress( string $kind, string $address, string $name = '' )
Adds an address to one of the recipient arrays Addresses that have been added already return false, but do not throw exceptions |
public
boolean
|
#
SetFrom( string $address, string $name = '', mixed $auto = 1 )
Set the From and FromName properties |
public static
boolean
|
#
ValidateAddress( string $address )
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 |
public
boolean
|
#
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. |
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
#
SmtpSend( string $header, string $body )
Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input. |
public
boolean
|
|
public
|
|
public
|
#
SetLanguage( string $langcode = 'en', string $lang_path = 'language/' )
Sets the language for all class error messages. Returns false if it cannot load the language file. The default language is English. |
public
array
|
|
public
string
|
|
public
string
|
|
public
string
|
#
WrapText( string $message, integer $length, boolean $qp_mode = false )
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable. Original written by philippe. |
public
integer
|
#
UTF8CharBoundary( string $encodedText, integer $maxLength )
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string. Original written by Colin Brown. |
public
|
|
public
string
|
|
public
string
|
|
public
string
|
|
private
|
#
GetBoundary( mixed $boundary, mixed $charSet, mixed $contentType, mixed $encoding )
Returns the start of a message boundary. |
private
|
|
private
|
|
public
string
|
|
public
string
|
|
public
boolean
|
#
AddAttachment( string $path, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' )
Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed. |
public
array
|
|
private
string
|
#
AttachAll( )
Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. |
private
string
|
#
EncodeFile( string $path, string $encoding = 'base64' )
Encodes attachment in requested format. Returns an empty string on failure. |
public
string
|
#
EncodeString( string $str, string $encoding = 'base64' )
Encodes string to requested format. Returns an empty string on failure. |
public
string
|
#
EncodeHeader( mixed $str, mixed $position = 'text' )
Encode a header string to best (shortest) of Q, B, quoted or none. |
public
boolean
|
|
public
string
|
#
Base64EncodeWrapMB( string $str )
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 |
public
string
|
#
EncodeQPphp( string $input = '', integer $line_max = 76, mixed $space_conv = false )
Encode string to quoted-printable. Only uses standard PHP, slow, but will always work |
public
string
|
#
EncodeQP( string $string, integer $line_max = 76, boolean $space_conv = false )
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 |
public
string
|
|
public
|
#
AddStringAttachment( string $string, string $filename, string $encoding = 'base64', string $type = 'application/octet-stream' )
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. |
public
boolean
|
#
AddEmbeddedImage( string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' )
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". |
public
boolean
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
ClearAttachments( )
Clears all previously set filesystem, string, and binary attachments. Returns void. |
public
|
|
protected
|
|
public static
string
|
|
private
string
|
|
private
string
|
|
public
boolean
|
|
private
string
|
|
public
|
|
public
mixed
|
#
MsgHTML( mixed $message, mixed $basedir = '' )
Evaluates the message and returns modifications for inline images and backgrounds |
public static
string
|
|
public
|
|
public
string
|
|
public
|
#
Sign( string $cert_filename, string $key_filename, mixed $key_pass )
Set the private key file and password to sign the message. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
DKIM_Add( string $headers_line, string $subject, string $body )
Create the DKIM header, body, as new header |
protected
|
Magic methods summary
Constants summary
integer |
STOP_MESSAGE |
0 |
|
integer |
STOP_CONTINUE |
1 |
|
integer |
STOP_CRITICAL |
2 |
Properties summary
public
integer
|
$Priority |
#
Email priority (1 = High, 3 = Normal, 5 = low). |
public
string
|
$CharSet |
#
Sets the CharSet of the message. |
public
string
|
$ContentType |
#
Sets the Content-type of the message. |
public
string
|
$Encoding |
#
Sets the Encoding of the message. Options for this are |
public
string
|
$ErrorInfo |
#
Holds the most recent mailer error message. |
public
string
|
$From |
#
Sets the From email address for the message. |
public
string
|
$FromName |
#
Sets the From name of the message. |
public
string
|
$Sender |
#
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. |
public
string
|
$Subject |
#
Sets the Subject of the message. |
public
string
|
$Body |
#
Sets the Body of the message. This can be either an HTML or text body. If HTML then run IsHTML(true). |
public
string
|
$AltBody |
#
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. |
public
integer
|
$WordWrap |
#
Sets word wrapping on the body of the message to a given number of characters. |
public
string
|
$Mailer |
#
Method to send mail: ("mail", "sendmail", or "smtp"). |
public
string
|
$Sendmail |
#
Sets the path of the sendmail program. |
public
string
|
$PluginDir |
#
Path to PHPMailer plugins. Useful if the SMTP class is in a different directory than the PHP include path. |
public
string
|
$ConfirmReadingTo |
#
Sets the email address that a reading confirmation will be sent. |
public
string
|
$Hostname |
#
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'. |
public
string
|
$MessageID |
#
Sets the message ID to be used in the Message-Id header. If empty, a unique id will be generated. |
public
string
|
$Host |
#
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. |
public
integer
|
$Port |
#
Sets the default SMTP server port. |
public
string
|
$Helo |
#
Sets the SMTP HELO of the message (Default is $Hostname). |
public
string
|
$SMTPSecure |
#
Sets connection prefix. Options are "", "ssl" or "tls" |
public
boolean
|
$SMTPAuth |
#
Sets SMTP authentication. Utilizes the Username and Password variables. |
public
string
|
$Username |
#
Sets SMTP username. |
public
string
|
$Password |
#
Sets SMTP password. |
public
integer
|
$Timeout |
#
Sets the SMTP server timeout in seconds. This function will not work with the win32 version. |
public
boolean
|
$SMTPDebug |
#
Sets SMTP class debugging on or off. |
public
boolean
|
$SMTPKeepAlive |
#
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(). |
public
boolean
|
$SingleTo |
#
Provides the ability to have the TO field process individual emails, instead of sending to entire TO addresses |
public
boolean
|
$SingleToArray |
#
If SingleTo is true, this provides the array to hold the email addresses |
public
string
|
$LE |
#
Provides the ability to change the line ending |
public
string
|
$DKIM_selector |
#
Used with DKIM DNS Resource Record |
public
string
|
$DKIM_identity |
#
Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com' |
public
string
|
$DKIM_domain |
#
Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com' |
public
string
|
$DKIM_private |
#
Used with DKIM DNS Resource Record optional, in format of email address 'you@yourdomain.com' |
public
string
|
$action_function |
#
Callback Action function name the function that handles the result of the
send email action. Parameters: |
public
string
|
$Version |
#
Sets the PHPMailer Version number |
private
mixed
|
$smtp | |
private
array
|
$to | |
private
array
|
$cc | |
private
array
|
$bcc | |
private
array
|
$ReplyTo | |
private
array
|
$all_recipients | |
private
array
|
$attachment | |
private
array
|
$CustomHeader | |
private
string
|
$message_type | |
private
array
|
$boundary | |
protected
array
|
$language | |
private
integer
|
$error_count | |
private
string
|
$sign_cert_file | |
private
string
|
$sign_key_file | |
private
string
|
$sign_key_pass | |
private
boolean
|
$exceptions |