PHPMailer Class Reference

List of all members.

Public Member Functions

 IsHTML ($bool)
 IsSMTP ()
 IsMail ()
 IsSendmail ()
 IsQmail ()
 AddAddress ($address, $name="")
 AddCC ($address, $name="")
 AddBCC ($address, $name="")
 AddReplyTo ($address, $name="")
 Send ()
 SendmailSend ($header, $body)
 MailSend ($header, $body)
 SmtpSend ($header, $body)
 SmtpConnect ()
 SmtpClose ()
 SetLanguage ($lang_type, $lang_path="")
 AddrAppend ($type, $addr)
 AddrFormat ($addr)
 WrapText ($message, $length, $qp_mode=false)
 SetWordWrap ()
 CreateHeader ()
 CreateBody ()
 GetBoundary ($boundary, $charSet, $contentType, $encoding)
 EndBoundary ($boundary)
 SetMessageType ()
 HeaderLine ($name, $value)
 TextLine ($value)
 AddAttachment ($path, $name="", $encoding="base64", $type="application/octet-stream")
 AttachAll ()
 EncodeFile ($path, $encoding="base64")
 EncodeString ($str, $encoding="base64")
 EncodeHeader ($str, $position= 'text')
 EncodeQP ($str)
 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 ()
 SetError ($msg)
 RFCDate ()
 Received ()
 ServerVar ($varName)
 ServerHostname ()
 Lang ($key)
 IsError ()
 FixEOL ($str)
 AddCustomHeader ($custom_header)

Public Attributes

 $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 = ""
 $Version = "1.71"
 $ConfirmReadingTo = ""
 $Hostname = ""
 $Host = "localhost"
 $Port = 25
 $Helo = ""
 $SMTPAuth = false
 $Username = ""
 $Password = ""
 $Timeout = 10
 $SMTPDebug = false
 $SMTPKeepAlive = false
 $smtp = NULL
 $to
 $cc
 $bcc
 $ReplyTo
 $attachment
 $CustomHeader
 $message_type = ""
 $boundary
 $language
 $error_count = 0
 $LE = "\n"

Detailed Description

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


Member Function Documentation

PHPMailer::IsHTML ( bool  ) 

Sets message type to HTML.

Parameters:
bool $bool
Returns:
void

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

PHPMailer::IsSMTP (  ) 

Sets Mailer to send message using SMTP.

Returns:
void

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

PHPMailer::IsMail (  ) 

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

Returns:
void

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

PHPMailer::IsSendmail (  ) 

Sets Mailer to send message using the $Sendmail program.

Returns:
void

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

PHPMailer::IsQmail (  ) 

Sets Mailer to send message using the qmail MTA.

Returns:
void

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

PHPMailer::AddAddress ( address,
name = "" 
)

Adds a "To" address.

Parameters:
string $address
string $name
Returns:
void

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

PHPMailer::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:
void

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

PHPMailer::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:
void

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

PHPMailer::AddReplyTo ( address,
name = "" 
)

Adds a "Reply-to" address.

Parameters:
string $address
string $name
Returns:
void

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

PHPMailer::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 366 of file class.phpmailer.php.

References CreateBody(), CreateHeader(), Lang(), MailSend(), SendmailSend(), SetError(), SetMessageType(), and SmtpSend().

Here is the call graph for this function:

PHPMailer::SendmailSend ( header,
body 
)

Sends mail using the $Sendmail program. private

Returns:
bool

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

References Lang(), and SetError().

Referenced by Send().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::MailSend ( header,
body 
)

Sends mail using the PHP mail() function. private

Returns:
bool

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

References $to, EncodeHeader(), Lang(), and SetError().

Referenced by Send().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
bool

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

References Lang(), SetError(), SmtpClose(), and SmtpConnect().

Referenced by Send().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::SmtpConnect (  ) 

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

Returns:
bool

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

References Lang(), ServerHostname(), and SetError().

Referenced by SmtpSend().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::SmtpClose (  ) 

Closes the active SMTP session if one exists.

Returns:
void

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

Referenced by SmtpSend().

Here is the caller graph for this function:

PHPMailer::SetLanguage ( lang_type,
lang_path = "" 
)

Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.

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

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

References SetError().

Referenced by Lang().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::AddrAppend ( type,
addr 
)

Creates recipient headers. private

Returns:
string

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

References AddrFormat().

Referenced by CreateHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::AddrFormat ( addr  ) 

Formats an address correctly. private

Returns:
string

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

References EncodeHeader().

Referenced by AddrAppend().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
string

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

References FixEOL().

Referenced by SetWordWrap().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::SetWordWrap (  ) 

Set the body wrapping. private

Returns:
void

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

References WrapText().

Referenced by CreateBody().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::CreateHeader (  ) 

Assembles message header. private

Returns:
string

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

References AddrAppend(), EncodeHeader(), HeaderLine(), InlineImageExists(), Received(), RFCDate(), ServerHostname(), and TextLine().

Referenced by Send().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::CreateBody (  ) 

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

Returns:
string

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

References AttachAll(), EncodeString(), EndBoundary(), GetBoundary(), IsError(), and SetWordWrap().

Referenced by Send().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::GetBoundary ( boundary,
charSet,
contentType,
encoding 
)

Returns the start of a message boundary. private

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

References $boundary, HeaderLine(), and TextLine().

Referenced by CreateBody().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::EndBoundary ( boundary  ) 

Returns the end of a message boundary. private

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

References $boundary.

Referenced by CreateBody().

Here is the caller graph for this function:

PHPMailer::SetMessageType (  ) 

Sets the message type. private

Returns:
void

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

Referenced by Send().

Here is the caller graph for this function:

PHPMailer::HeaderLine ( name,
value 
)

Returns a formatted header line. private

Returns:
string

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

Referenced by CreateHeader(), and GetBoundary().

Here is the caller graph for this function:

PHPMailer::TextLine ( value  ) 

Returns a formatted mail line. private

Returns:
string

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

Referenced by CreateHeader(), and GetBoundary().

Here is the caller graph for this function:

PHPMailer::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 $path Path to the attachment.
string $name Overrides the attachment name.
string $encoding File encoding (see $Encoding).
string $type File extension (MIME) type.
Returns:
bool

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

References Lang(), and SetError().

Here is the call graph for this function:

PHPMailer::AttachAll (  ) 

Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. private

Returns:
string

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

References EncodeFile(), EncodeString(), and IsError().

Referenced by CreateBody().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::EncodeFile ( path,
encoding = "base64" 
)

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

Returns:
string

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

References EncodeString(), Lang(), and SetError().

Referenced by AttachAll().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::EncodeString ( str,
encoding = "base64" 
)

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

Returns:
string

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

References EncodeQP(), FixEOL(), Lang(), and SetError().

Referenced by AttachAll(), CreateBody(), and EncodeFile().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::EncodeHeader ( str,
position = 'text' 
)

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

Returns:
string

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

Referenced by AddrFormat(), CreateHeader(), and MailSend().

Here is the caller graph for this function:

PHPMailer::EncodeQP ( str  ) 

Encode string to quoted-printable. private

Returns:
string

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

Referenced by EncodeString().

Here is the caller graph for this function:

PHPMailer::EncodeQ ( str,
position = "text" 
)

Encode string to q encoding. private

Returns:
string

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

PHPMailer::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 $string String attachment data.
string $filename Name of the attachment.
string $encoding File encoding (see $Encoding).
string $type File extension (MIME) type.
Returns:
void

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

PHPMailer::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 $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.
Returns:
bool

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

References Lang(), and SetError().

Here is the call graph for this function:

PHPMailer::InlineImageExists (  ) 

Returns true if an inline attachment is present. private

Returns:
bool

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

Referenced by CreateHeader().

Here is the caller graph for this function:

PHPMailer::ClearAddresses (  ) 

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

Returns:
void

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

PHPMailer::ClearCCs (  ) 

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

Returns:
void

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

PHPMailer::ClearBCCs (  ) 

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

Returns:
void

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

PHPMailer::ClearReplyTos (  ) 

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

Returns:
void

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

PHPMailer::ClearAllRecipients (  ) 

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

Returns:
void

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

PHPMailer::ClearAttachments (  ) 

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

Returns:
void

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

PHPMailer::ClearCustomHeaders (  ) 

Clears all custom headers. Returns void.

Returns:
void

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

PHPMailer::SetError ( msg  ) 

Adds the error message to the error container. Returns void. private

Returns:
void

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

Referenced by AddAttachment(), AddEmbeddedImage(), EncodeFile(), EncodeString(), MailSend(), Send(), SendmailSend(), SetLanguage(), SmtpConnect(), and SmtpSend().

Here is the caller graph for this function:

PHPMailer::RFCDate (  ) 

Returns the proper RFC 822 formatted date. private

Returns:
string

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

Referenced by CreateHeader(), and Received().

Here is the caller graph for this function:

PHPMailer::Received (  ) 

Returns Received header for message tracing. private

Returns:
string

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

References RFCDate(), ServerHostname(), and ServerVar().

Referenced by CreateHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
mixed

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

Referenced by Received(), and ServerHostname().

Here is the caller graph for this function:

PHPMailer::ServerHostname (  ) 

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

Returns:
string

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

References ServerVar().

Referenced by CreateHeader(), Received(), and SmtpConnect().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::Lang ( key  ) 

Returns a message in the appropriate language. private

Returns:
string

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

References SetLanguage().

Referenced by AddAttachment(), AddEmbeddedImage(), EncodeFile(), EncodeString(), MailSend(), Send(), SendmailSend(), SmtpConnect(), and SmtpSend().

Here is the call graph for this function:

Here is the caller graph for this function:

PHPMailer::IsError (  ) 

Returns true if an error occurred.

Returns:
bool

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

Referenced by AttachAll(), and CreateBody().

Here is the caller graph for this function:

PHPMailer::FixEOL ( str  ) 

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

Returns:
string

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

Referenced by EncodeString(), and WrapText().

Here is the caller graph for this function:

PHPMailer::AddCustomHeader ( custom_header  ) 

Adds a custom header.

Returns:
void

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


Member Data Documentation

PHPMailer::$Priority = 3

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

PHPMailer::$CharSet = "iso-8859-1"

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

PHPMailer::$ContentType = "text/plain"

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

PHPMailer::$Encoding = "8bit"

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

PHPMailer::$ErrorInfo = ""

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

PHPMailer::$From = "root@localhost"

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

PHPMailer::$FromName = "Root User"

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

PHPMailer::$Sender = ""

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

PHPMailer::$Subject = ""

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

PHPMailer::$Body = ""

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

PHPMailer::$AltBody = ""

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

PHPMailer::$WordWrap = 0

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

PHPMailer::$Mailer = "mail"

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

PHPMailer::$Sendmail = "/usr/sbin/sendmail"

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

PHPMailer::$PluginDir = ""

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

PHPMailer::$Version = "1.71"

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

PHPMailer::$ConfirmReadingTo = ""

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

PHPMailer::$Hostname = ""

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

PHPMailer::$Host = "localhost"

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

PHPMailer::$Port = 25

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

PHPMailer::$Helo = ""

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

PHPMailer::$SMTPAuth = false

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

PHPMailer::$Username = ""

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

PHPMailer::$Password = ""

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

PHPMailer::$Timeout = 10

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

PHPMailer::$SMTPDebug = false

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

PHPMailer::$SMTPKeepAlive = false

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

PHPMailer::$smtp = NULL

#@+ private

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

PHPMailer::$to

Initial value:

 array(
        )

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

Referenced by MailSend().

PHPMailer::$cc

Initial value:

 array(
        )

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

PHPMailer::$bcc

Initial value:

 array(
        )

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

PHPMailer::$ReplyTo

Initial value:

 array(
        )

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

PHPMailer::$attachment

Initial value:

 array(
        )

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

PHPMailer::$CustomHeader

Initial value:

 array(
        )

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

PHPMailer::$message_type = ""

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

PHPMailer::$boundary

Initial value:

 array(
        )

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

Referenced by EndBoundary(), and GetBoundary().

PHPMailer::$language

Initial value:

 array(
        )

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

PHPMailer::$error_count = 0

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

PHPMailer::$LE = "\n"

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


The documentation for this class was generated from the following file:
CopyLeft (L) 2001-2006 - [MIOLO Development Team] SOLIS - Cooperativa de Soluções Livres - Lajeado/RS - Brasil