Class: PHPMailer

Source Location: /bblog/inc/class.phpmailer.php ( Revision Log )

Class PHPMailer

Direct descendents
Child Class Description
bblogMailer PHPMailer - PHP email transport class

[ Top ]
Property Summary
string   $AltBody   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.
string   $Body   Sets the Body of the message. This can be either an HTML or text body.
string   $CharSet   Sets the CharSet of the message.
string   $ConfirmReadingTo   Sets the email address that a reading confirmation will be sent.
string   $ContentType   Sets the Content-type of the message.
string   $Encoding   Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
string   $ErrorInfo   Holds the most recent mailer error message.
string   $From   Sets the From email address for the message.
string   $FromName   Sets the From name of the message.
string   $Helo   Sets the SMTP HELO of the message (Default is $Hostname).
string   $Host   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").
string   $Hostname   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'.
string   $Mailer   Method to send mail: ("mail", "sendmail", or "smtp").
string   $Password   Sets SMTP password.
string   $PluginDir   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   Sets the default SMTP server port.
int   $Priority   Email priority (1 = High, 3 = Normal, 5 = low).
string   $Sender   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.
string   $Sendmail   Sets the path of the sendmail program.
bool   $SMTPAuth   Sets SMTP authentication. Utilizes the Username and Password variables.
bool   $SMTPDebug   Sets SMTP class debugging on or off.
bool   $SMTPKeepAlive   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   $Subject   Sets the Subject of the message.
int   $Timeout   Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
string   $Username   Sets SMTP username.
string   $Version   Holds PHPMailer version.
int   $WordWrap   Sets word wrapping on the body of the message to a given number of characters.

[ Top ]
Method Summary
void   AddAddress()   Adds a "To" address.
bool   AddAttachment()   Adds an attachment from a path on the filesystem.
void   AddBCC()   Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
void   AddCC()   Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
void   AddCustomHeader()   Adds a custom header.
bool   AddEmbeddedImage()   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".
void   AddReplyTo()   Adds a "Reply-to" address.
void   AddStringAttachment()   Adds a string or binary attachment (non-filesystem) to the list.
void   ClearAddresses()   Clears all recipients assigned in the TO array. Returns void.
void   ClearAllRecipients()   Clears all recipients assigned in the TO, CC and BCC array. Returns void.
void   ClearAttachments()   Clears all previously set filesystem, string, and binary attachments. Returns void.
void   ClearBCCs()   Clears all recipients assigned in the BCC array. Returns void.
void   ClearCCs()   Clears all recipients assigned in the CC array. Returns void.
void   ClearCustomHeaders()   Clears all custom headers. Returns void.
void   ClearReplyTos()   Clears all recipients assigned in the ReplyTo array. Returns void.
bool   IsError()   Returns true if an error occurred.
void   IsHTML()   Sets message type to HTML.
void   IsMail()   Sets Mailer to send message using PHP mail() function.
void   IsQmail()   Sets Mailer to send message using the qmail MTA.
void   IsSendmail()   Sets Mailer to send message using the $Sendmail program.
void   IsSMTP()   Sets Mailer to send message using SMTP.
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.
bool   SetLanguage()   Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.
void   SmtpClose()   Closes the active SMTP session if one exists.

[ Top ]
Properties
string   $AltBody = "" [line 96]

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.


[ Top ]
string   $Body = "" [line 87]

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

If HTML then run IsHTML(true).


[ Top ]
string   $CharSet = "iso-8859-1" [line 36]

Sets the CharSet of the message.


[ Top ]
string   $ConfirmReadingTo = "" [line 134]

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


[ Top ]
string   $ContentType = "text/plain" [line 42]

Sets the Content-type of the message.


[ Top ]
string   $Encoding = "8bit" [line 49]

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


[ Top ]
string   $ErrorInfo = "" [line 55]

Holds the most recent mailer error message.


[ Top ]
string   $From = "root@localhost" [line 61]

Sets the From email address for the message.


Redefined in descendants as:
  • bblogMailer::$From : TODO: i'd rather have $Host be read from bb_config, instead of writing it here. Just incase any robot would come, or any faggot wants to hack this file for spam reasons.

[ Top ]
string   $FromName = "Root User" [line 67]

Sets the From name of the message.


Redefined in descendants as:

[ Top ]
string   $Helo = "" [line 168]

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


[ Top ]
string   $Host = "localhost" [line 156]

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.


Redefined in descendants as:

[ Top ]
string   $Hostname = "" [line 142]

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


[ Top ]
string   $Mailer = "mail" [line 109]

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


Redefined in descendants as:

[ Top ]
string   $Password = "" [line 186]

Sets SMTP password.


[ Top ]
string   $PluginDir = "" [line 122]

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


[ Top ]
int   $Port = 25 [line 162]

Sets the default SMTP server port.


[ Top ]
int   $Priority = 3 [line 30]

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


[ Top ]
string   $Sender = "" [line 74]

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.


[ Top ]
string   $Sendmail = "/usr/sbin/sendmail" [line 115]

Sets the path of the sendmail program.


[ Top ]
bool   $SMTPAuth = false [line 174]

Sets SMTP authentication. Utilizes the Username and Password variables.


[ Top ]
bool   $SMTPDebug = false [line 199]

Sets SMTP class debugging on or off.


[ Top ]
bool   $SMTPKeepAlive = false [line 207]

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


[ Top ]
string   $Subject = "" [line 80]

Sets the Subject of the message.


[ Top ]
int   $Timeout = 10 [line 193]

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


[ Top ]
string   $Username = "" [line 180]

Sets SMTP username.


[ Top ]
string   $Version = "1.73" [line 128]

Holds PHPMailer version.


[ Top ]
int   $WordWrap = 0 [line 103]

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


Redefined in descendants as:

[ Top ]
Methods
AddAddress  [line 286]

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

Adds a "To" address.

Parameters:
string   $address: 
string   $name: 


[ Top ]
AddAttachment  [line 996]

  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 ]
AddBCC  [line 314]

  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 ]
AddCC  [line 300]

  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 ]
AddCustomHeader  [line 1494]

  void AddCustomHeader( mixed $custom_header  )

Adds a custom header.



[ Top ]
AddEmbeddedImage  [line 1274]

  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 ]
AddReplyTo  [line 326]

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

Adds a "Reply-to" address.

Parameters:
string   $address: 
string   $name: 


[ Top ]
AddStringAttachment  [line 1247]

  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 ]
ClearAddresses  [line 1328]

  void ClearAddresses( )

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



[ Top ]
ClearAllRecipients  [line 1361]

  void ClearAllRecipients( )

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



[ Top ]
ClearAttachments  [line 1372]

  void ClearAttachments( )

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



[ Top ]
ClearBCCs  [line 1344]

  void ClearBCCs( )

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



[ Top ]
ClearCCs  [line 1336]

  void ClearCCs( )

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



[ Top ]
ClearCustomHeaders  [line 1380]

  void ClearCustomHeaders( )

Clears all custom headers. Returns void.



[ Top ]
ClearReplyTos  [line 1352]

  void ClearReplyTos( )

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



[ Top ]
IsError  [line 1474]

  bool IsError( )

Returns true if an error occurred.



[ Top ]
IsHTML  [line 235]

  void IsHTML( bool $bool  )

Sets message type to HTML.

Parameters:
bool   $bool: 


[ Top ]
IsMail  [line 254]

  void IsMail( )

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



[ Top ]
IsQmail  [line 270]

  void IsQmail( )

Sets Mailer to send message using the qmail MTA.



[ Top ]
IsSendmail  [line 262]

  void IsSendmail( )

Sets Mailer to send message using the $Sendmail program.



[ Top ]
IsSMTP  [line 246]

  void IsSMTP( )

Sets Mailer to send message using SMTP.



[ Top ]
Send  [line 343]

  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 ]
SetLanguage  [line 596]

  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.

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

API Tags:
Access:  public


[ Top ]
SmtpClose  [line 576]

  void SmtpClose( )

Closes the active SMTP session if one exists.



[ Top ]