Moodle  2.2.1
http://www.collinsharper.com
PHPMailer Class Reference
Inheritance diagram for PHPMailer:

Public Member Functions

 __construct ($exceptions=false)
 IsHTML ($ishtml=true)
 IsSMTP ()
 IsMail ()
 IsSendmail ()
 IsQmail ()
 AddAddress ($address, $name= '')
 AddCC ($address, $name= '')
 AddBCC ($address, $name= '')
 AddReplyTo ($address, $name= '')
 SetFrom ($address, $name= '', $auto=1)
 Send ()
 SmtpConnect ()
 SmtpClose ()
 SetLanguage ($langcode= 'en', $lang_path= 'language/')
 GetTranslations ()
 AddrAppend ($type, $addr)
 AddrFormat ($addr)
 WrapText ($message, $length, $qp_mode=false)
 UTF8CharBoundary ($encodedText, $maxLength)
 SetWordWrap ()
 CreateHeader ()
 GetMailMIME ()
 CreateBody ()
 HeaderLine ($name, $value)
 TextLine ($value)
 AddAttachment ($path, $name= '', $encoding= 'base64', $type= 'application/octet-stream')
 GetAttachments ()
 EncodeString ($str, $encoding= 'base64')
 EncodeHeader ($str, $position= 'text')
 HasMultiBytes ($str)
 Base64EncodeWrapMB ($str)
 EncodeQPphp ($input= '', $line_max=76, $space_conv=false)
 EncodeQP ($string, $line_max=76, $space_conv=false)
 EncodeQ ($str, $position= 'text')
 AddStringAttachment ($string, $filename, $encoding= 'base64', $type= 'application/octet-stream')
 AddEmbeddedImage ($path, $cid, $name= '', $encoding= 'base64', $type= 'application/octet-stream')
 InlineImageExists ()
 ClearAddresses ()
 ClearCCs ()
 ClearBCCs ()
 ClearReplyTos ()
 ClearAllRecipients ()
 ClearAttachments ()
 ClearCustomHeaders ()
 IsError ()
 AddCustomHeader ($custom_header)
 MsgHTML ($message, $basedir= '')
 set ($name, $value= '')
 SecureHeader ($str)
 Sign ($cert_filename, $key_filename, $key_pass)
 DKIM_QP ($txt)
 DKIM_Sign ($s)
 DKIM_HeaderC ($s)
 DKIM_BodyC ($body)
 DKIM_Add ($headers_line, $subject, $body)

Static Public Member Functions

static ValidateAddress ($address)
static RFCDate ()
static _mime_types ($ext= '')

Data Fields

 $Priority = 3
 $CharSet = 'iso-8859-1'
 $ContentType = 'text/plain'
 $Encoding = '8bit'
 $ErrorInfo = ''
 $From = 'root@localhost'
 $FromName = 'Root User'
 $Sender = ''
 $Subject = ''
 $Body = ''
 $AltBody = ''
 $WordWrap = 0
 $Mailer = 'mail'
 $Sendmail = '/usr/sbin/sendmail'
 $PluginDir = ''
 $ConfirmReadingTo = ''
 $Hostname = ''
 $MessageID = ''
 $Host = 'localhost'
 $Port = 25
 $Helo = ''
 $SMTPSecure = ''
 $SMTPAuth = false
 $Username = ''
 $Password = ''
 $Timeout = 10
 $SMTPDebug = false
 $SMTPKeepAlive = false
 $SingleTo = false
 $SingleToArray = array()
 $LE = "\n"
 $DKIM_selector = 'phpmailer'
 $DKIM_identity = ''
 $DKIM_domain = ''
 $DKIM_private = ''
 $action_function = ''
 $Version = '5.1'
const STOP_MESSAGE = 0
const STOP_CONTINUE = 1
const STOP_CRITICAL = 2

Protected Member Functions

 SendmailSend ($header, $body)
 MailSend ($header, $body)
 SmtpSend ($header, $body)
 SetError ($msg)
 doCallback ($isSent, $to, $cc, $bcc, $subject, $body)

Protected Attributes

 $language = array()

Detailed Description

Definition at line 43 of file class.phpmailer.php.


Constructor & Destructor Documentation

__construct ( exceptions = false)

Constructor

Parameters:
boolean$exceptionsShould we throw external exceptions?

Definition at line 342 of file class.phpmailer.php.


Member Function Documentation

static _mime_types ( ext = '') [static]

Gets the MIME type of the embedded or inline image

Parameters:
stringFile extension public
Returns:
string MIME type of ext

Definition at line 2041 of file class.phpmailer.php.

Here is the caller graph for this function:

AddAddress ( address,
name = '' 
)

Adds a "To" address.

Parameters:
string$address
string$name
Returns:
boolean true on success, false if address already used

Definition at line 407 of file class.phpmailer.php.

AddAttachment ( path,
name = '',
encoding = 'base64',
type = 'application/octet-stream' 
)

Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed.

Parameters:
string$pathPath to the attachment.
string$nameOverrides the attachment name.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns:
bool

Definition at line 1344 of file class.phpmailer.php.

Here is the call graph for this function:

AddBCC ( address,
name = '' 
)

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

Parameters:
string$address
string$name
Returns:
boolean true on success, false if address already used

Definition at line 429 of file class.phpmailer.php.

AddCC ( address,
name = '' 
)

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

Parameters:
string$address
string$name
Returns:
boolean true on success, false if address already used

Definition at line 418 of file class.phpmailer.php.

AddCustomHeader ( custom_header)

Adds a custom header. public

Returns:
void

Reimplemented in moodle_phpmailer.

Definition at line 1994 of file class.phpmailer.php.

AddEmbeddedImage ( path,
cid,
name = '',
encoding = 'base64',
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".

Parameters:
string$pathPath to the attachment.
string$cidContent ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
string$nameOverrides the attachment name.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns:
bool

Definition at line 1783 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

AddrAppend ( type,
addr 
)

Creates recipient headers. public

Returns:
string

Definition at line 897 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

AddReplyTo ( address,
name = '' 
)

Adds a "Reply-to" address.

Parameters:
string$address
string$name
Returns:
boolean

Definition at line 439 of file class.phpmailer.php.

AddrFormat ( addr)

Formats an address correctly. public

Returns:
string

Definition at line 914 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

AddStringAttachment ( string,
filename,
encoding = 'base64',
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.

Parameters:
string$stringString attachment data.
string$filenameName of the attachment.
string$encodingFile encoding (see $Encoding).
string$typeFile extension (MIME) type.
Returns:
void

Definition at line 1756 of file class.phpmailer.php.

Base64EncodeWrapMB ( 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

Parameters:
string$strmulti-byte text to wrap encode
Returns:
string

Definition at line 1599 of file class.phpmailer.php.

Here is the caller graph for this function:

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

Returns:
void

Definition at line 1832 of file class.phpmailer.php.

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

Returns:
void

Definition at line 1874 of file class.phpmailer.php.

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

Returns:
void

Definition at line 1886 of file class.phpmailer.php.

ClearBCCs ( )

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

Returns:
void

Definition at line 1854 of file class.phpmailer.php.

ClearCCs ( )

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

Returns:
void

Definition at line 1843 of file class.phpmailer.php.

Clears all custom headers. Returns void.

Returns:
void

Definition at line 1894 of file class.phpmailer.php.

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

Returns:
void

Definition at line 1865 of file class.phpmailer.php.

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

Returns:
string The assembled message body

Definition at line 1190 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Assembles message header. public

Returns:
string The assembled header

Definition at line 1073 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

DKIM_Add ( headers_line,
subject,
body 
)

Create the DKIM header, body, as new header

public

Parameters:
string$headers_lineHeader lines
string$subjectSubject
string$bodyBody

Definition at line 2271 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

DKIM_BodyC ( body)

Generate DKIM Canonicalization Body

public

Parameters:
string$bodyMessage Body

Definition at line 2251 of file class.phpmailer.php.

Here is the caller graph for this function:

DKIM_HeaderC ( s)

Generate DKIM Canonicalization Header

public

Parameters:
string$sHeader

Definition at line 2232 of file class.phpmailer.php.

Here is the caller graph for this function:

DKIM_QP ( txt)

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

public

Parameters:
string$key_filenameParameter File Name
string$key_passPassword for private key

Definition at line 2194 of file class.phpmailer.php.

Here is the caller graph for this function:

DKIM_Sign ( s)

Generate DKIM signature

public

Parameters:
string$sHeader

Definition at line 2214 of file class.phpmailer.php.

Here is the caller graph for this function:

doCallback ( isSent,
to,
cc,
bcc,
subject,
body 
) [protected]

Definition at line 2306 of file class.phpmailer.php.

Here is the caller graph for this function:

EncodeHeader ( str,
position = 'text' 
)

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

Returns:
string

Reimplemented in moodle_phpmailer.

Definition at line 1522 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

EncodeQ ( str,
position = 'text' 
)

Encode string to q encoding. string $str the text to encode string $position Where the text is going to be used, see the RFC for what that means public string

Definition at line 1721 of file class.phpmailer.php.

Here is the caller graph for this function:

EncodeQP ( string,
line_max = 76,
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

See also:
EncodeQPphp() User interface
Parameters:
string$stringthe text to encode
integer$line_maxNumber of chars allowed on a line before wrapping
boolean$space_convDummy param for compatibility with existing EncodeQP function
Returns:
string
Author:
Marcus Bointon

Reimplemented in moodle_phpmailer.

Definition at line 1692 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

EncodeQPphp ( input = '',
line_max = 76,
space_conv = false 
)

Encode string to quoted-printable. Only uses standard PHP, slow, but will always work public

Parameters:
string$stringthe text to encode
integer$line_maxNumber of chars allowed on a line before wrapping
Returns:
string

Definition at line 1639 of file class.phpmailer.php.

Here is the caller graph for this function:

EncodeString ( str,
encoding = 'base64' 
)

Encodes string to requested format. Returns an empty string on failure.

Parameters:
string$strThe text to encode
string$encodingThe encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' public
Returns:
string

Definition at line 1491 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Return the current array of attachments

Returns:
array

Definition at line 1382 of file class.phpmailer.php.

Returns the message MIME. public

Returns:
string

Definition at line 1156 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Return the current array of language strings

Returns:
array

Definition at line 884 of file class.phpmailer.php.

HasMultiBytes ( str)

Checks if a string contains multibyte characters. public

Parameters:
string$strmulti-byte text to wrap encode
Returns:
bool

Definition at line 1583 of file class.phpmailer.php.

Here is the caller graph for this function:

HeaderLine ( name,
value 
)

Returns a formatted header line. public

Returns:
string

Definition at line 1317 of file class.phpmailer.php.

Here is the caller graph for this function:

Returns true if an inline attachment is present. public

Returns:
bool

Definition at line 1815 of file class.phpmailer.php.

Here is the caller graph for this function:

IsError ( )

Returns true if an error occurred. public

Returns:
bool

Definition at line 1973 of file class.phpmailer.php.

Here is the caller graph for this function:

IsHTML ( ishtml = true)

Sets message type to HTML.

Parameters:
bool$ishtml
Returns:
void

Definition at line 351 of file class.phpmailer.php.

Here is the caller graph for this function:

IsMail ( )

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

Returns:
void

Definition at line 371 of file class.phpmailer.php.

IsQmail ( )

Sets Mailer to send message using the qmail MTA.

Returns:
void

Definition at line 390 of file class.phpmailer.php.

Sets Mailer to send message using the $Sendmail program.

Returns:
void

Definition at line 379 of file class.phpmailer.php.

IsSMTP ( )

Sets Mailer to send message using SMTP.

Returns:
void

Definition at line 363 of file class.phpmailer.php.

MailSend ( header,
body 
) [protected]

Sends mail using the PHP mail() function.

Parameters:
string$headerThe message headers
string$bodyThe message body protected
Returns:
bool

Definition at line 644 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

MsgHTML ( message,
basedir = '' 
)

Evaluates the message and returns modifications for inline images and backgrounds public

Returns:
$message

Definition at line 2003 of file class.phpmailer.php.

Here is the call graph for this function:

static RFCDate ( ) [static]

Returns the proper RFC 822 formatted date. public

Returns:
string

Reimplemented in moodle_phpmailer.

Definition at line 1924 of file class.phpmailer.php.

SecureHeader ( str)

Strips newlines to prevent header injection. public

Parameters:
string$strString
Returns:
string

Definition at line 2168 of file class.phpmailer.php.

Here is the caller graph for this function:

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.

Returns:
bool

Definition at line 545 of file class.phpmailer.php.

Here is the call graph for this function:

SendmailSend ( header,
body 
) [protected]

Sends mail using the $Sendmail program.

Parameters:
string$headerThe message headers
string$bodyThe message body protected
Returns:
bool

Definition at line 598 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set ( name,
value = '' 
)

Set (or reset) Class Objects (variables)

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

public

Parameters:
string$nameParameter Name
mixed$valueParameter Value NOTE: will not work with arrays, there are no arrays to set/reset
Todo:
Should this not be using __set() magic function?

Definition at line 2146 of file class.phpmailer.php.

Here is the call graph for this function:

SetError ( msg) [protected]

Adds the error message to the error container. protected

Returns:
void

Definition at line 1907 of file class.phpmailer.php.

Here is the caller graph for this function:

SetFrom ( address,
name = '',
auto = 1 
)

Set the From and FromName properties

Parameters:
string$address
string$name
Returns:
boolean

Definition at line 488 of file class.phpmailer.php.

Here is the call graph for this function:

SetLanguage ( langcode = 'en',
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.

Parameters:
string$langcodeISO 639-1 2-character language code (e.g. Portuguese: "br")
string$lang_pathPath to the language file directory public

Definition at line 850 of file class.phpmailer.php.

Set the body wrapping. public

Returns:
void

Definition at line 1052 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Sign ( cert_filename,
key_filename,
key_pass 
)

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

public

Parameters:
string$key_filenameParameter File Name
string$key_passPassword for private key

Definition at line 2181 of file class.phpmailer.php.

SmtpClose ( )

Closes the active SMTP session if one exists.

Returns:
void

Definition at line 834 of file class.phpmailer.php.

Initiates a connection to an SMTP server. Returns false if the operation failed. SMTP public

Returns:
bool

Definition at line 772 of file class.phpmailer.php.

Here is the caller graph for this function:

SmtpSend ( header,
body 
) [protected]

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

Parameters:
string$headerThe message headers
string$bodyThe message body SMTP protected
Returns:
bool

Definition at line 701 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

TextLine ( value)

Returns a formatted mail line. public

Returns:
string

Definition at line 1326 of file class.phpmailer.php.

Here is the caller graph for this function:

UTF8CharBoundary ( encodedText,
maxLength 
)

Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string. Original written by Colin Brown. public

Parameters:
string$encodedTextutf-8 QP text
int$maxLengthfind last character boundary prior to this length
Returns:
int

Definition at line 1014 of file class.phpmailer.php.

Here is the caller graph for this function:

static ValidateAddress ( address) [static]

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 Original pattern found here string $address The email address to check boolean public

Definition at line 523 of file class.phpmailer.php.

WrapText ( message,
length,
qp_mode = false 
)

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

Parameters:
string$messageThe message to wrap
integer$lengthThe line length to wrap to
boolean$qp_modeWhether to run in Quoted-Printable mode public
Returns:
string

Definition at line 932 of file class.phpmailer.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$action_function = ''

Definition at line 297 of file class.phpmailer.php.

$AltBody = ''

Definition at line 119 of file class.phpmailer.php.

$Body = ''

Definition at line 110 of file class.phpmailer.php.

$CharSet = 'iso-8859-1'

Definition at line 59 of file class.phpmailer.php.

$ConfirmReadingTo = ''

Definition at line 151 of file class.phpmailer.php.

$ContentType = 'text/plain'

Definition at line 65 of file class.phpmailer.php.

$DKIM_domain = ''

Definition at line 277 of file class.phpmailer.php.

$DKIM_identity = ''

Definition at line 270 of file class.phpmailer.php.

$DKIM_private = ''

Definition at line 284 of file class.phpmailer.php.

$DKIM_selector = 'phpmailer'

Definition at line 263 of file class.phpmailer.php.

$Encoding = '8bit'

Definition at line 72 of file class.phpmailer.php.

$ErrorInfo = ''

Definition at line 78 of file class.phpmailer.php.

$From = 'root@localhost'

Definition at line 84 of file class.phpmailer.php.

$FromName = 'Root User'

Definition at line 90 of file class.phpmailer.php.

$Helo = ''

Definition at line 192 of file class.phpmailer.php.

$Host = 'localhost'

Definition at line 180 of file class.phpmailer.php.

$Hostname = ''

Definition at line 159 of file class.phpmailer.php.

$language = array() [protected]

Definition at line 319 of file class.phpmailer.php.

$LE = "\n"

Definition at line 257 of file class.phpmailer.php.

$Mailer = 'mail'

Definition at line 132 of file class.phpmailer.php.

$MessageID = ''

Definition at line 166 of file class.phpmailer.php.

$Password = ''

Definition at line 217 of file class.phpmailer.php.

$PluginDir = ''

Definition at line 145 of file class.phpmailer.php.

$Port = 25

Definition at line 186 of file class.phpmailer.php.

$Priority = 3

Definition at line 53 of file class.phpmailer.php.

$Sender = ''

Definition at line 97 of file class.phpmailer.php.

$Sendmail = '/usr/sbin/sendmail'

Definition at line 138 of file class.phpmailer.php.

$SingleTo = false

Definition at line 245 of file class.phpmailer.php.

$SingleToArray = array()

Definition at line 251 of file class.phpmailer.php.

$SMTPAuth = false

Definition at line 205 of file class.phpmailer.php.

$SMTPDebug = false

Definition at line 230 of file class.phpmailer.php.

$SMTPKeepAlive = false

Definition at line 238 of file class.phpmailer.php.

$SMTPSecure = ''

Definition at line 199 of file class.phpmailer.php.

$Subject = ''

Definition at line 103 of file class.phpmailer.php.

$Timeout = 10

Definition at line 224 of file class.phpmailer.php.

$Username = ''

Definition at line 211 of file class.phpmailer.php.

$Version = '5.1'

Definition at line 303 of file class.phpmailer.php.

$WordWrap = 0

Definition at line 126 of file class.phpmailer.php.

const STOP_CONTINUE = 1

Definition at line 331 of file class.phpmailer.php.

const STOP_CRITICAL = 2

Definition at line 332 of file class.phpmailer.php.

const STOP_MESSAGE = 0

Definition at line 330 of file class.phpmailer.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations