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

Class: PHPMailer

Source Location: /shared/phpmailer/class.phpmailer.php

Class Overview


PHPMailer - PHP email transport class


Author(s):

  • Brent R. Matzelle

Copyright:

  • 2001 - 2003 Brent R. Matzelle

Variables

Methods


Child classes:

C_mailer
C_mailer - PHPMailer class extension

Class Details

[line 28]
PHPMailer - PHP email transport class



Tags:

author:  Brent R. Matzelle
copyright:  2001 - 2003 Brent R. Matzelle


[ Top ]


Class Variables

$AltBody =  ""

[line 104]

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.


Type:   string


[ Top ]

$attachment = array()

[line 225]



Tags:

access:  private

Type:   mixed


[ Top ]

$bcc = array()

[line 223]



Tags:

access:  private

Type:   mixed


[ Top ]

$Body =  ""

[line 95]

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

If HTML then run IsHTML(true).



Type:   string


[ Top ]

$boundary = array()

[line 228]



Tags:

access:  private

Type:   mixed


[ Top ]

$cc = array()

[line 222]



Tags:

access:  private

Type:   mixed


[ Top ]

$CharSet =  "iso-8859-1"

[line 44]

Sets the CharSet of the message.


Type:   string


[ Top ]

$ConfirmReadingTo =  ""

[line 142]

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


Type:   string


[ Top ]

$ContentType =  "text/plain"

[line 50]

Sets the Content-type of the message.


Type:   string


[ Top ]

$CustomHeader = array()

[line 226]



Tags:

access:  private

Type:   mixed


[ Top ]

$Encoding =  "8bit"

[line 57]

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


Type:   string


[ Top ]

$ErrorInfo =  ""

[line 63]

Holds the most recent mailer error message.


Type:   string


[ Top ]

$error_count =  0

[line 230]



Tags:

access:  private

Type:   mixed


[ Top ]

$From =  "root@localhost"

[line 69]

Sets the From email address for the message.


Type:   string


[ Top ]

$FromName =  "Root User"

[line 75]

Sets the From name of the message.


Type:   string


[ Top ]

$Helo =  ""

[line 176]

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


Type:   string


[ Top ]

$Host =  "localhost"

[line 164]

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.



Type:   string


[ Top ]

$Hostname =  ""

[line 150]

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


Type:   string


[ Top ]

$language = array()

[line 229]



Tags:

access:  private

Type:   mixed


[ Top ]

$LE =  "\n"

[line 231]



Tags:

access:  private

Type:   mixed


[ Top ]

$Mailer =  "mail"

[line 117]

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


Type:   string


[ Top ]

$message_type =  ""

[line 227]



Tags:

access:  private

Type:   mixed


[ Top ]

$Password =  ""

[line 194]

Sets SMTP password.


Type:   string


[ Top ]

$PluginDir =  ""

[line 130]

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


Type:   string


[ Top ]

$Port =  25

[line 170]

Sets the default SMTP server port.


Type:   int


[ Top ]

$Priority =  3

[line 38]

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


Type:   int


[ Top ]

$ReplyTo = array()

[line 224]



Tags:

access:  private

Type:   mixed


[ Top ]

$Sender =  ""

[line 82]

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.


Type:   string


[ Top ]

$Sendmail =  "/usr/sbin/sendmail"

[line 123]

Sets the path of the sendmail program.


Type:   string


[ Top ]

$smtp =  NULL

[line 220]



Tags:

access:  private

Type:   mixed


[ Top ]

$SMTPAuth =  false

[line 182]

Sets SMTP authentication. Utilizes the Username and Password variables.


Type:   bool


[ Top ]

$SMTPDebug =  false

[line 207]

Sets SMTP class debugging on or off.


Type:   bool


[ Top ]

$SMTPKeepAlive =  false

[line 215]

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


Type:   bool


[ Top ]

$Subject =  ""

[line 88]

Sets the Subject of the message.


Type:   string


[ Top ]

$Timeout =  10

[line 201]

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


Type:   int


[ Top ]

$to = array()

[line 221]



Tags:

access:  private

Type:   mixed


[ Top ]

$Username =  ""

[line 188]

Sets SMTP username.


Type:   string


[ Top ]

$Version =  "1.73"

[line 136]

Holds PHPMailer version.


Type:   string


[ Top ]

$WordWrap =  0

[line 111]

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


Type:   int


[ Top ]



Class Methods


method AddAddress [line 294]

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

Adds a "To" address.



Parameters:

string   $address  
string   $name  

[ Top ]

method AddAttachment [line 1004]

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.




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 322]

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.



Parameters:

string   $address  
string   $name  

[ Top ]

method AddCC [line 308]

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.



Parameters:

string   $address  
string   $name  

[ Top ]

method AddCustomHeader [line 1502]

void AddCustomHeader( $custom_header)

Adds a custom header.



Parameters:

   $custom_header  

[ Top ]

method AddEmbeddedImage [line 1282]

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



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 628]

string AddrAppend( $type, $addr)

Creates recipient headers.



Tags:

access:  private


Parameters:

   $type  
   $addr  

[ Top ]

method AddReplyTo [line 334]

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

Adds a "Reply-to" address.



Parameters:

string   $address  
string   $name  

[ Top ]

method AddrFormat [line 646]

string AddrFormat( $addr)

Formats an address correctly.



Tags:

access:  private


Parameters:

   $addr  

[ Top ]

method AddStringAttachment [line 1255]

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.




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 1035]

string AttachAll( )

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

Returns an empty string on failure.




Tags:

access:  private


[ Top ]

method ClearAddresses [line 1336]

void ClearAddresses( )

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



[ Top ]

method ClearAllRecipients [line 1369]

void ClearAllRecipients( )

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



[ Top ]

method ClearAttachments [line 1380]

void ClearAttachments( )

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



[ Top ]

method ClearBCCs [line 1352]

void ClearBCCs( )

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



[ Top ]

method ClearCCs [line 1344]

void ClearCCs( )

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



[ Top ]

method ClearCustomHeaders [line 1388]

void ClearCustomHeaders( )

Clears all custom headers. Returns void.



[ Top ]

method ClearReplyTos [line 1360]

void ClearReplyTos( )

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



[ Top ]

method CreateBody [line 863]

string CreateBody( )

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



Tags:

access:  private


[ Top ]

method CreateHeader [line 765]

string CreateHeader( )

Assembles message header.



Tags:

access:  private


[ Top ]

method EncodeFile [line 1092]

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

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



Tags:

access:  private


Parameters:

   $path  
   $encoding  

[ Top ]

method EncodeHeader [line 1145]

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

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



Tags:

access:  private


Parameters:

   $str  
   $position  

[ Top ]

method EncodeQ [line 1221]

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

Encode string to q encoding.



Tags:

access:  private


Parameters:

   $str  
   $position  

[ Top ]

method EncodeQP [line 1198]

string EncodeQP( $str)

Encode string to quoted-printable.



Tags:

access:  private


Parameters:

   $str  

[ Top ]

method EncodeString [line 1114]

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

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



Tags:

access:  private


Parameters:

   $str  
   $encoding  

[ Top ]

method EndBoundary [line 949]

void EndBoundary( $boundary)

Returns the end of a message boundary.



Tags:

access:  private


Parameters:

   $boundary  

[ Top ]

method FixEOL [line 1491]

string FixEOL( $str)

Changes every end of line from CR or LF to CRLF.



Tags:

access:  private


Parameters:

   $str  

[ Top ]

method GetBoundary [line 929]

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

Returns the start of a message boundary.



Tags:

access:  private


Parameters:

   $boundary  
   $charSet  
   $contentType  
   $encoding  

[ Top ]

method HeaderLine [line 977]

string HeaderLine( $name, $value)

Returns a formatted header line.



Tags:

access:  private


Parameters:

   $name  
   $value  

[ Top ]

method InlineImageExists [line 1314]

bool InlineImageExists( )

Returns true if an inline attachment is present.



Tags:

access:  private


[ Top ]

method IsError [line 1482]

bool IsError( )

Returns true if an error occurred.



[ Top ]

method IsHTML [line 243]

void IsHTML( bool $bool)

Sets message type to HTML.



Parameters:

bool   $bool  

[ Top ]

method IsMail [line 262]

void IsMail( )

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



[ Top ]

method IsQmail [line 278]

void IsQmail( )

Sets Mailer to send message using the qmail MTA.



[ Top ]

method IsSendmail [line 270]

void IsSendmail( )

Sets Mailer to send message using the $Sendmail program.



[ Top ]

method IsSMTP [line 254]

void IsSMTP( )

Sets Mailer to send message using SMTP.



[ Top ]

method Lang [line 1468]

string Lang( $key)

Returns a message in the appropriate language.



Tags:

access:  private


Overridden in child classes as:

C_mailer::Lang()
Returns a message in the appropriate language.

Parameters:

   $key  

[ Top ]

method MailSend [line 429]

bool MailSend( $header, $body)

Sends mail using the PHP mail() function.



Tags:

access:  private


Parameters:

   $header  
   $body  

[ Top ]

method RFCDate [line 1413]

string RFCDate( )

Returns the proper RFC 822 formatted date.



Tags:

access:  private


[ Top ]

method Send [line 351]

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.



[ Top ]

method SendmailSend [line 399]

bool SendmailSend( $header, $body)

Sends mail using the $Sendmail program.



Tags:

access:  private


Parameters:

   $header  
   $body  

[ Top ]

method ServerHostname [line 1452]

string ServerHostname( )

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



Tags:

access:  private


[ Top ]

method ServerVar [line 1430]

mixed ServerVar( $varName)

Returns the appropriate server variable. Should work with both PHP 4.1.0+ as well as older versions. Returns an empty string if nothing is found.



Tags:

access:  private


Parameters:

   $varName  

[ Top ]

method SetError [line 1403]

void SetError( $msg)

Adds the error message to the error container.

Returns void.




Tags:

access:  private


Overridden in child classes as:

C_mailer::SetError()
Replace the default SetError

Parameters:

   $msg  

[ Top ]

method SetLanguage [line 604]

bool SetLanguage( string $lang_type, [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 958]

void SetMessageType( )

Sets the message type.



Tags:

access:  private


[ Top ]

method SetWordWrap [line 743]

void SetWordWrap( )

Set the body wrapping.



Tags:

access:  private


[ Top ]

method SmtpClose [line 584]

void SmtpClose( )

Closes the active SMTP session if one exists.



[ Top ]

method SmtpConnect [line 534]

bool SmtpConnect( )

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



Tags:

access:  private


[ Top ]

method SmtpSend [line 467]

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:  private


Parameters:

   $header  
   $body  

[ Top ]

method TextLine [line 986]

string TextLine( $value)

Returns a formatted mail line.



Tags:

access:  private


Parameters:

   $value  

[ Top ]

method WrapText [line 665]

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:  private


Parameters:

   $message  
   $length  
   $qp_mode  

[ Top ]


Documentation generated on Fri, 05 Dec 2008 16:03:47 +0100 by phpDocumentor 1.4.1