68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class PHPMailer

Description
Direct descendents
Class Description
 class Mailer Mailer class handles email and extends phpmailer.
Variable Summary
 string $AltBody
 mixed $attachment
 mixed $bcc
 string $Body
 mixed $boundary
 mixed $cc
 string $CharSet
 string $ContentType
 string $Encoding
 string $ErrorInfo
 mixed $error_count
 string $From
 string $FromName
 string $Helo
 string $Host
 string $Hostname
 mixed $language
 mixed $LE
 string $Mailer
 string $MessageID
 string $Password
 string $PluginDir
 int $Port
 int $Priority
 mixed $ReplyTo
 string $Sender
 string $Sendmail
 bool $SingleTo
 mixed $smtp
 bool $SMTPAuth
 bool $SMTPDebug
 string $SMTPSecure
 string $Subject
 int $Timeout
 mixed $to
 string $Username
 string $Version
 int $WordWrap
Method Summary
 void AddAddress (string $address, [string $name = ''])
 bool AddAttachment (string $path, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
 void AddBCC (string $address, [string $name = ''])
 void AddCC (string $address, [string $name = ''])
 void AddCustomHeader ( $custom_header)
 bool AddEmbeddedImage (string $path, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
 void AddReplyTo (string $address, [string $name = ''])
 void AddStringAttachment (string $string, string $filename, [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
 void ClearAddresses ()
 void ClearBCCs ()
 void ClearCCs ()
 void ClearReplyTos ()
 void getFile (string $filename)
 void HeaderLine ( $name,  $value)
 bool IsError ()
 void IsHTML (bool $bool)
 void IsMail ()
 void IsQmail ()
 void IsSendmail ()
 void IsSMTP ()
 $message MsgHTML ( $message, [ $basedir = ''])
 bool Send ()
 void set (string $name, [mixed $value = ''])
 bool SetLanguage (string $lang_type, [string $lang_path = 'language/'])
 void Sign (string $key_filename, string $key_pass)
 void SmtpClose ()
Variables
string $AltBody = '' (line 110)

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.

mixed $attachment = array() (line 253)
mixed $bcc = array() (line 251)
string $Body = '' (line 101)

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

If HTML then run IsHTML(true).

mixed $boundary = array() (line 256)
mixed $cc = array() (line 250)
string $CharSet = 'UTF-8' (line 50)

Sets the CharSet of the message.

string $ConfirmReadingTo = '' (line 148)

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

string $ContentType = 'text/plain' (line 56)

Sets the Content-type of the message.

mixed $CustomHeader = array() (line 254)
string $Encoding = '8bit' (line 63)

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

string $ErrorInfo = '' (line 69)

Holds the most recent mailer error message.

mixed $error_count = 0 (line 258)
string $From = 'root@localhost' (line 75)

Sets the From email address for the message.


Redefined in descendants as:
string $FromName = 'Root User' (line 81)

Sets the From name of the message.


Redefined in descendants as:
string $Helo = '' (line 189)

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

string $Host = 'localhost' (line 177)

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.

string $Hostname = '' (line 156)

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

mixed $language = array() (line 257)
mixed $LE = "\n" (line 259)
string $Mailer = 'mail' (line 123)

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

string $MessageID = '' (line 163)

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

If empty, a unique id will be generated.

mixed $message_type = '' (line 255)
string $Password = '' (line 214)

Sets SMTP password.

string $PluginDir = '' (line 136)

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

int $Port = 25 (line 183)

Sets the default SMTP server port.

int $Priority = 3 (line 44)

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

mixed $ReplyTo = array() (line 252)
string $Sender = '' (line 88)

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.


Redefined in descendants as:
string $Sendmail = '/usr/sbin/sendmail' (line 129)

Sets the path of the sendmail program.

mixed $sign_key_file = "" (line 260)
mixed $sign_key_pass = "" (line 261)
bool $SingleTo = false (line 242)

Provides the ability to have the TO field process individual

emails, instead of sending to entire TO addresses

mixed $smtp = NULL (line 248)
bool $SMTPAuth = false (line 202)

Sets SMTP authentication. Utilizes the Username and Password variables.

bool $SMTPDebug = false (line 227)

Sets SMTP class debugging on or off.

bool $SMTPKeepAlive = false (line 235)

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

string $SMTPSecure = "" (line 196)

Sets connection prefix.

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

string $Subject = '' (line 94)

Sets the Subject of the message.

int $Timeout = 10 (line 221)

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

mixed $to = array() (line 249)
string $Username = '' (line 208)

Sets SMTP username.

string $Version = "2.0.2" (line 142)

Holds PHPMailer version.

int $WordWrap = 0 (line 117)

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

Methods
AddAddress (line 323)

Adds a "To" address.

void AddAddress (string $address, [string $name = ''])
  • string $address
  • string $name
AddAttachment (line 1110)

Adds an attachment from a path on the filesystem.

Returns false if the file could not be found or accessed.

bool AddAttachment (string $path, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
  • string $path: Path to the attachment.
  • string $name: Overrides the attachment name.
  • string $encoding: File encoding (see $Encoding).
  • string $type: File extension (MIME) type.
AddBCC (line 351)

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

void AddBCC (string $address, [string $name = ''])
  • string $address
  • string $name
AddCC (line 337)

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

void AddCC (string $address, [string $name = ''])
  • string $address
  • string $name
AddCustomHeader (line 1690)

Adds a custom header.

void AddCustomHeader ( $custom_header)
  • $custom_header
AddEmbeddedImage (line 1470)

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

bool AddEmbeddedImage (string $path, string $cid, [string $name = ''], [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
  • 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.
AddReplyTo (line 363)

Adds a "Reply-To" address.

void AddReplyTo (string $address, [string $name = ''])
  • string $address
  • string $name
AddStringAttachment (line 1444)

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.

void AddStringAttachment (string $string, string $filename, [string $encoding = 'base64'], [string $type = 'application/octet-stream'])
  • string $string: String attachment data.
  • string $filename: Name of the attachment.
  • string $encoding: File encoding (see $Encoding).
  • string $type: File extension (MIME) type.
ClearAddresses (line 1521)

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

void ClearAddresses ()
ClearAllRecipients (line 1554)

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

void ClearAllRecipients ()
ClearAttachments (line 1565)

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

void ClearAttachments ()
ClearBCCs (line 1537)

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

void ClearBCCs ()
ClearCCs (line 1529)

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

void ClearCCs ()
ClearCustomHeaders (line 1573)

Clears all custom headers. Returns void.

void ClearCustomHeaders ()
ClearReplyTos (line 1545)

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

void ClearReplyTos ()
getFile (line 1856)

Read a file from a supplied filename and return it.

  • access: public
void getFile (string $filename)
  • string $filename: Parameter File Name
HeaderLine (line 1083)
void HeaderLine ( $name,  $value)
  • $name
  • $value
IsError (line 1670)

Returns true if an error occurred.

bool IsError ()
IsHTML (line 272)

Sets message type to HTML.

void IsHTML (bool $bool)
  • bool $bool
IsMail (line 292)

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

void IsMail ()
IsQmail (line 308)

Sets Mailer to send message using the qmail MTA.

void IsQmail ()
IsSendmail (line 300)

Sets Mailer to send message using the $Sendmail program.

void IsSendmail ()
IsSMTP (line 284)

Sets Mailer to send message using SMTP.

void IsSMTP ()
MsgHTML (line 1699)

Evaluates the message and returns modifications for inline images and backgrounds

  • access: public
$message MsgHTML ( $message, [ $basedir = ''])
  • $message
  • $basedir
Send (line 379)

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.

bool Send ()
set (line 1841)

Set (or reset) Class Objects (variables)

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

  • access: public
void set (string $name, [mixed $value = ''])
  • string $name: Parameter Name
  • mixed $value: Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset
SetLanguage (line 646)

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

  • access: public
bool SetLanguage (string $lang_type, [string $lang_path = 'language/'])
  • string $lang_type: Type of language (e.g. Portuguese: "br")
  • string $lang_path: Path to the language file directory
Sign (line 1889)

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

  • access: public
void Sign (string $key_filename, string $key_pass)
  • string $key_filename: Parameter File Name
  • string $key_pass: Password for private key
SmtpClose (line 628)

Closes the active SMTP session if one exists.

void SmtpClose ()