phpCoreLib2
[ class tree: phpCoreLib2 ] [ index: phpCoreLib2 ] [ all elements ]

Class: DPHPMailer

Source Location: /Mails/DPHPMailer.php

Class Overview

DObject
   |
   --DPHPMailer



Author(s):

  • of mod - Deso

Variables

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: DObject

DObject::__construct()
Constructor
DObject::debug()
Debig
DObject::getClassMembers()
Gets member variables of the instance
DObject::getClassMemberType()
Gets class member type
DObject::getClassMethods()
Gets classes of the class
DObject::getClassName()
Gets class name
DObject::PHPSerialize()
Gets serialized string of the class
DObject::trace()
Trace
DObject::__destruct()
Descructor
DObject::__toString()
Returns String equivalent of the object.

Class Details

[line 42]


Tags:

author:  of mod - Deso


[ Top ]


Class Variables

$AltBody =  ''

[line 118]

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.



Tags:

access:  public

Type:   string


[ Top ]

$Body =  ''

[line 109]

Sets the Body of the message. This can be either an HTML or text body.

If HTML then run IsHTML(true).




Tags:

access:  public

Type:   string


[ Top ]

$CharSet =  'utf-8'

[line 58]

Sets the CharSet of the message.



Tags:

access:  public

Type:   string


[ Top ]

$ConfirmReadingTo =  ''

[line 156]

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



Tags:

access:  public

Type:   string


[ Top ]

$ContentType =  'text/plain'

[line 64]

Sets the Content-type of the message.



Tags:

access:  public

Type:   string


[ Top ]

$Encoding =  '8bit'

[line 71]

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



Tags:

access:  public

Type:   string


[ Top ]

$ErrorInfo =  ''

[line 77]

Holds the most recent mailer error message.



Tags:

access:  public

Type:   string


[ Top ]

$From =  'root@localhost'

[line 83]

Sets the From email address for the message.



Tags:

access:  public

Type:   string


[ Top ]

$FromName =  'Root User'

[line 89]

Sets the From name of the message.



Tags:

access:  public

Type:   string


[ Top ]

$Helo =  ''

[line 197]

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



Tags:

access:  public

Type:   string


[ Top ]

$Host =  'localhost'

[line 185]

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.




Tags:

access:  public

Type:   string


[ Top ]

$Hostname =  ''

[line 164]

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



Tags:

access:  public

Type:   string


[ Top ]

$Mailer =  'mail'

[line 131]

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



Tags:

access:  public

Type:   string


[ Top ]

$MessageID =  ''

[line 171]

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

If empty, a unique id will be generated.




Tags:

access:  public

Type:   string


[ Top ]

$Password =  ''

[line 222]

Sets SMTP password.



Tags:

access:  public

Type:   string


[ Top ]

$PluginDir =  ''

[line 144]

Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.



Tags:

access:  public

Type:   string


[ Top ]

$Port =  25

[line 191]

Sets the default SMTP server port.



Tags:

access:  public

Type:   int


[ Top ]

$Priority =  3

[line 52]

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



Tags:

access:  public

Type:   int


[ Top ]

$Sender =  ''

[line 96]

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.



Tags:

access:  public

Type:   string


[ Top ]

$Sendmail =  '/usr/sbin/sendmail'

[line 137]

Sets the path of the sendmail program.



Tags:

access:  public

Type:   string


[ Top ]

$SingleTo =  false

[line 250]

Provides the ability to have the TO field process individual

emails, instead of sending to entire TO addresses




Tags:

access:  public

Type:   bool


[ Top ]

$SMTPAuth =  false

[line 210]

Sets SMTP authentication. Utilizes the Username and Password variables.



Tags:

access:  public

Type:   bool


[ Top ]

$SMTPDebug =  false

[line 235]

Sets SMTP class debugging on or off.



Tags:

access:  public

Type:   bool


[ Top ]

$SMTPKeepAlive =  false

[line 243]

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



Tags:

access:  public

Type:   bool


[ Top ]

$SMTPSecure =  ""

[line 204]

Sets connection prefix.

Options are "", "ssl" or "tls"




Tags:

access:  public

Type:   string


[ Top ]

$Subject =  ''

[line 102]

Sets the Subject of the message.



Tags:

access:  public

Type:   string


[ Top ]

$Timeout =  10

[line 229]

Sets the SMTP server timeout in seconds. This function will not work with the win32 version.



Tags:

access:  public

Type:   int


[ Top ]

$Username =  ''

[line 216]

Sets SMTP username.



Tags:

access:  public

Type:   string


[ Top ]

$Version =  "2.2"

[line 150]

Holds PHPMailer version.



Tags:

access:  public

Type:   string


[ Top ]

$WordWrap =  0

[line 125]

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



Tags:

access:  public

Type:   int


[ Top ]



Class Methods


method AddAddress [line 387]

void AddAddress( string $address, [string $name = ''])

Adds a "To" address.



Tags:

access:  public


Parameters:

string   $address  
string   $name  

[ Top ]

method AddAttachment [line 1210]

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




Tags:

access:  public


Parameters:

string   $path   Path to the attachment.
string   $name   Overrides the attachment name.
string   $encoding   File encoding (see $Encoding).
string   $type   File extension (MIME) type.

[ Top ]

method AddBCC [line 419]

void AddBCC( string $address, [string $name = ''])

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



Tags:

access:  public


Parameters:

string   $address  
string   $name  

[ Top ]

method AddCC [line 405]

void AddCC( string $address, [string $name = ''])

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



Tags:

access:  public


Parameters:

string   $address  
string   $name  

[ Top ]

method AddCustomHeader [line 1776]

void AddCustomHeader( $custom_header)

Adds a custom header.



Tags:

access:  public


Parameters:

   $custom_header  

[ Top ]

method AddEmbeddedImage [line 1579]

bool 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".



Tags:

access:  public


Parameters:

string   $path   Path to the attachment.
string   $cid   Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
string   $name   Overrides the attachment name.
string   $encoding   File encoding (see $Encoding).
string   $type   File extension (MIME) type.

[ Top ]

method AddrAppend [line 764]

string AddrAppend( $type, $addr)

Creates recipient headers.



Tags:

access:  public


Parameters:

   $type  
   $addr  

[ Top ]

method AddReplyTo [line 431]

void AddReplyTo( string $address, [string $name = ''])

Adds a "Reply-to" address.



Tags:

access:  public


Parameters:

string   $address  
string   $name  

[ Top ]

method AddrFormat [line 782]

string AddrFormat( $addr)

Formats an address correctly.



Tags:

access:  public


Parameters:

   $addr  

[ Top ]

method AddStringAttachment [line 1553]

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




Tags:

access:  public


Parameters:

string   $string   String attachment data.
string   $filename   Name of the attachment.
string   $encoding   File encoding (see $Encoding).
string   $type   File extension (MIME) type.

[ Top ]

method AttachAll [line 1240]

string AttachAll( )

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

Returns an empty string on failure.




Tags:

access:  public


[ Top ]

method Base64EncodeWrapMB [line 1434]

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




Tags:

access:  public


Parameters:

string   $str   multi-byte text to wrap encode

[ Top ]

method ClearAddresses [line 1630]

void ClearAddresses( )

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



Tags:

access:  public


[ Top ]

method ClearAllRecipients [line 1663]

void ClearAllRecipients( )

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



Tags:

access:  public


[ Top ]

method ClearAttachments [line 1674]

void ClearAttachments( )

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



Tags:

access:  public


[ Top ]

method ClearBCCs [line 1646]

void ClearBCCs( )

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



Tags:

access:  public


[ Top ]

method ClearCCs [line 1638]

void ClearCCs( )

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



Tags:

access:  public


[ Top ]

method ClearCustomHeaders [line 1682]

void ClearCustomHeaders( )

Clears all custom headers. Returns void.



Tags:

access:  public


[ Top ]

method ClearReplyTos [line 1654]

void ClearReplyTos( )

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



Tags:

access:  public


[ Top ]

method clearTo [line 393]

void clearTo( )



Tags:

access:  public


[ Top ]

method CreateBody [line 1056]

string CreateBody( )

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



Tags:

access:  public


[ Top ]

method CreateHeader [line 941]

string CreateHeader( )

Assembles message header.



Tags:

access:  public


[ Top ]

method EncodeFile [line 1300]

string EncodeFile( $path, [ $encoding = 'base64'])

Encodes attachment in requested format. Returns an empty string on failure.



Tags:

access:  public


Parameters:

   $path  
   $encoding  

[ Top ]

method EncodeHeader [line 1357]

string EncodeHeader( $str, [ $position = 'text'])

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



Tags:

access:  public


Parameters:

   $str  
   $position  

[ Top ]

method EncodeQ [line 1519]

string EncodeQ( $str, [ $position = 'text'])

Encode string to q encoding.



Tags:

access:  public


Parameters:

   $str  
   $position  

[ Top ]

method EncodeQP [line 1473]

string EncodeQP( [ $input = ''], [integer $line_max = 76], [ $space_conv = false], string $string)

Encode string to quoted-printable.



Tags:

access:  public


Parameters:

string   $string   the text to encode
integer   $line_max   Number of chars allowed on a line before wrapping
   $input  
   $space_conv  

[ Top ]

method EncodeString [line 1327]

string EncodeString( $str, [ $encoding = 'base64'])

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



Tags:

access:  public


Parameters:

   $str  
   $encoding  

[ Top ]

method EndBoundary [line 1154]

void EndBoundary( $boundary)

Returns the end of a message boundary.



Tags:

access:  public


Parameters:

   $boundary  

[ Top ]

method GetBoundary [line 1130]

void GetBoundary( $boundary, $charSet, $contentType, $encoding)

Returns the start of a message boundary.



Tags:

access:  public


Parameters:

   $boundary  
   $charSet  
   $contentType  
   $encoding  

[ Top ]

method getFile [line 1942]

void getFile( string $filename)

Read a file from a supplied filename and return it.



Tags:

access:  public


Parameters:

string   $filename   Parameter File Name

[ Top ]

method GetMailMIME [line 1021]

string GetMailMIME( )

Returns the message MIME.



Tags:

access:  public


[ Top ]

method HasMultiBytes [line 1418]

bool HasMultiBytes( string $str)

Checks if a string contains multibyte characters.



Tags:

access:  public


Parameters:

string   $str   multi-byte text to wrap encode

[ Top ]

method HeaderLine [line 1183]

void HeaderLine( $name, $value)



Tags:

access:  public


Parameters:

   $name  
   $value  

[ Top ]

method InlineImageExists [line 1610]

bool InlineImageExists( )

Returns true if an inline attachment is present.



Tags:

access:  public


[ Top ]

method IsError [line 1755]

bool IsError( )

Returns true if an error occurred.



Tags:

access:  public


[ Top ]

method IsHTML [line 336]

void IsHTML( bool $bool)

Sets message type to HTML.



Tags:

access:  public


Parameters:

bool   $bool  

[ Top ]

method IsMail [line 356]

void IsMail( )

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



Tags:

access:  public


[ Top ]

method IsQmail [line 372]

void IsQmail( )

Sets Mailer to send message using the qmail MTA.



Tags:

access:  public


[ Top ]

method IsSendmail [line 364]

void IsSendmail( )

Sets Mailer to send message using the $Sendmail program.



Tags:

access:  public


[ Top ]

method IsSMTP [line 348]

void IsSMTP( )

Sets Mailer to send message using SMTP.



Tags:

access:  public


[ Top ]

method loadTemplate [line 288]

boolean loadTemplate( string $fullPathToTemplate)

Load smarty template for use in BODY



Tags:

return:  true on no error and false on error (when template not found)
access:  public


Parameters:

string   $fullPathToTemplate   Path to template

[ Top ]

method MailSend [line 536]

bool MailSend( $header, $body)

Sends mail using the PHP mail() function.



Tags:

access:  public


Parameters:

   $header  
   $body  

[ Top ]

method MsgHTML [line 1785]

$message MsgHTML( $message, [ $basedir = ''])

Evaluates the message and returns modifications for inline images and backgrounds



Tags:

access:  public


Parameters:

   $message  
   $basedir  

[ Top ]

method SecureHeader [line 1961]

string SecureHeader( string $str)

Strips newlines to prevent header injection.



Tags:

access:  public


Parameters:

string   $str   String

[ Top ]

method Send [line 447]

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



Tags:

access:  public


[ Top ]

method SendmailSend [line 504]

bool SendmailSend( $header, $body)

Sends mail using the $Sendmail program.



Tags:

access:  public


Parameters:

   $header  
   $body  

[ Top ]

method set [line 1927]

void set( string $name, [mixed $value = ''])

Set (or reset) Class Objects (variables)

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




Tags:

access:  public


Parameters:

string   $name   Parameter Name
mixed   $value   Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset

[ Top ]

method SetLanguage [line 733]

bool SetLanguage( [string $lang_type = '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 type is English.



Tags:

access:  public


Parameters:

string   $lang_type   Type of language (e.g. Portuguese: "br")
string   $lang_path   Path to the language file directory

[ Top ]

method SetMessageType [line 1163]

void SetMessageType( )

Sets the message type.



Tags:

access:  public


[ Top ]

method SetWordWrap [line 919]

void SetWordWrap( )

Set the body wrapping.



Tags:

access:  public


[ Top ]

method Sign [line 1975]

void Sign( $cert_filename, string $key_filename, string $key_pass)

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



Tags:

access:  public


Parameters:

string   $key_filename   Parameter File Name
string   $key_pass   Password for private key
   $cert_filename  

[ Top ]

method SmtpClose [line 715]

void SmtpClose( )

Closes the active SMTP session if one exists.



Tags:

access:  public


[ Top ]

method SmtpConnect [line 653]

bool SmtpConnect( )

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



Tags:

access:  public


[ Top ]

method SmtpSend [line 586]

bool SmtpSend( $header, $body)

Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input.



Tags:

access:  public


Parameters:

   $header  
   $body  

[ Top ]

method TextLine [line 1192]

string TextLine( $value)

Returns a formatted mail line.



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method tplAssign [line 315]

boolean tplAssign( string $var, mixed $value)

Assign variable to template engine



Tags:

return:  false on error other - true
access:  public


Parameters:

string   $var   Name of variable
mixed   $value   Value of variable

[ Top ]

method UTF8CharBoundary [line 881]

int UTF8CharBoundary( string $encodedText, int $maxLength)

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

Original written by Colin Brown.




Tags:

access:  public


Parameters:

string   $encodedText   utf-8 QP text
int   $maxLength   find last character boundary prior to this length

[ Top ]

method WrapText [line 799]

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




Tags:

access:  public


Parameters:

   $message  
   $length  
   $qp_mode  

[ Top ]

method _mime_types [line 1823]

mime _mime_types( [ $ext = ''])

Gets the mime type of the embedded or inline image



Tags:

return:  type of ext
access:  public


Parameters:

   $ext  

[ Top ]


Documentation generated on Sat, 17 Apr 2010 22:09:41 +0300 by phpDocumentor 1.4.3