Class THTMLMail

Description

Class TMail.

Class TMail. Filename.......: class.html.mime.mail.inc Project........: HTML Mime mail class Last Modified..: $Date: 2002/07/24 13:14:10 $ CVS Revision...: $Revision: 1.4 $ Copyright......: 2001, 2002 Richard Heyes Adapted for PRADO

  • version: $Revision: $ $Date: $
  • author: Yassel Omar Izquierdo Souchay <sioy23@gmail.com>

Located in /THTMLMail.php (line 17)

TModule
   |
   --THTMLMail
Variable Summary
string $_attachments
string $_headers
string $_html
string $_html_text
boolean $_is_built
string $_output
string $_return_path
string $_text
Method Summary
void addAttachment (string $file, [string $name = ''], [string $c_type = 'application/octet-stream'], [string $encoding = 'base64'])
void addHtmlImage (string $file, [string $name = ''], [string $c_type = 'application/octet-stream'])
mixed buildMessage ([mixed $params = array()])
string getAttachments ()
string getBuild_params ()
mixed getFile (string $filename)
string getHeaders ()
string getHtml ()
mixed getHtml_images ()
string getHtml_text ()
mixed getImage_types ()
boolean getIs_built ()
string getOutput ()
string getReturn_path ()
mixed getRFC822 (mixed $recipients)
mixed getSmtp_params ()
string getText ()
void init (unknown_type $config)
void onInit (TEventParameter $param)
mixed send (array $recipients, [string $type = 'mail'])
void setAttachments (string $value)
void setBcc (string $bcc)
void setBuild_params (string $value)
void setCc (string $cc)
void setCrlf ([string $crlf = "\n"])
void setFrom (string $from)
void setHeadCharset ([string $charset = 'ISO-8859-1'])
void setHeader (string $name, mixed $value)
void setHeaders (string $value)
void setHtml (string $value)
void setHtmlCharset ([string $charset = 'ISO-8859-1'])
void setHtmlContent (string $html, [string $text = null], [string $images_dir = null])
void setHtmlEncoding ([string $encoding = 'quoted-printable'])
void setHtml_images (mixed $value)
void setHtml_text (string $value)
void setImage_types (mixed $value)
void setIs_built (boolean $value)
void setOutput (string $value)
void setReturnPath (string $return_path)
void setReturn_path (string $value)
void setSMTPParams ([string $host = null], [integer $port = null], [string $helo = null], [string $auth = null], [string $user = null], [string $pass = null])
void setSmtp_params (mixed $value)
void setSubject (string $subject)
void setText (string $value)
void setTextCharset ([string $charset = 'ISO-8859-1'])
void setTextEncoding ([string $encoding = '7bit'])
void setTextWrap ([integer $count = 998])
mixed _addAlternativePart (mixed &$obj)
void &_addAttachmentPart (mixed &$obj, mixed $value)
void &_addHtmlImagePart (mixed &$obj, mixed $value)
mixed &_addHtmlPart (mixed &$obj)
mixed &_addMixedPart ()
mixed &_addRelatedPart (mixed &$obj)
mixed &_addTextPart (mixed &$obj, string $text)
string _encodeHeader (string $input, [string $charset = 'ISO-8859-1'])
void _findHtmlImages (string $images_dir)
Variables
string $_attachments = '' (line 50)
  • var: Array of attachments
  • access: private
string $_build_params = '' (line 46)
  • var: Parameters that affect the build process
  • access: private
string $_headers = '' (line 54)
  • var: The main message headers
  • access: private
string $_html = '' (line 22)
  • var: The html part of the message
  • access: private
mixed $_html_images = null (line 38)
  • var: An array of embedded images/objects
  • access: private
string $_html_text = '' (line 34)
  • var: The alternative text to the HTML part (only used in HTML messages)
  • access: private
mixed $_image_types = null (line 42)
  • var: An array of recognised image types for the findHtmlImages() method
  • access: private
boolean $_is_built = false (line 58)
  • var: Whether the message has been built or not
  • access: private
string $_output = '' (line 30)
  • var: The main body of the message after building
  • access: private
string $_return_path = '' (line 62)
  • var: The return path address. If not set the From:address is used instead
  • access: private
mixed $_smtp_params = null (line 66)
  • var: Array of information needed for smtp sending
  • access: private
string $_text = '' (line 26)
  • var: The text part of the message(only used in TEXT only messages)
  • access: private
Methods
addAttachment (line 632)

Adds a file to the list of attachments

Adds a file to the list of attachments

  • access: protected
void addAttachment (string $file, [string $name = ''], [string $c_type = 'application/octet-stream'], [string $encoding = 'base64'])
  • string $file
  • string $name
  • string $c_type: Default application/octet-stream
  • string $encoding: Default base64
addHtmlImage (line 610)

Adds an image to the list of embedded images

Adds an image to the list of embedded images

  • access: public
void addHtmlImage (string $file, [string $name = ''], [string $c_type = 'application/octet-stream'])
  • string $file
  • string $name
  • string $c_type: Default application/octet-stream
buildMessage (line 783)

Builds the multipart message from the list ($this->_parts). array of parameters that shape the building of the message. $params['html_encoding'] - The type of encoding to use on html. "7bit", "quoted-printable" or "base64" (all without quotes).

Builds the multipart message from the list ($this->_parts). $params is an array of parameters that shape the building of the message. Currently supported are: $params['html_encoding'] - The type of encoding to use on html. Valid options are "7bit", "quoted-printable" or "base64" (all without quotes). 7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable $params['text_encoding'] - The type of encoding to use on plain text Valid options are "7bit", "quoted-printable" or "base64" (all without quotes). Default is 7bit $params['text_wrap'] - The character count at which to wrap 7bit encoded data. Default this is 998. $params['html_charset'] - The character set to use for a html section. Default is ISO-8859-1 $params['text_charset'] - The character set to use for a text section.

  • Default is ISO-8859-1
$params['head_charset'] - The character set to use for header encoding should it be needed.
  • Default is ISO-8859-1

  • access: protected
mixed buildMessage ([mixed $params = array()])
  • mixed $params
getAttachments (line 183)
  • return: Array of attachments Defaults to ''.
  • access: public
string getAttachments ()
getBuild_params (line 167)
  • return: Parameters that affect the build process Defaults to ''.
  • access: public
string getBuild_params ()
getFile (line 350)

This function will read a file in from a supplied filename and return it. argument of the the functions add_html_image() or add_attachment().

This function will read a file in from a supplied filename and return it. This can then be given as the first argument of the the functions add_html_image() or add_attachment().

  • access: public
mixed getFile (string $filename)
  • string $filename
getHeaders (line 199)
  • return: The main message headers Defaults to ''.
  • access: public
string getHeaders ()
getHtml (line 71)
  • return: The html part of the message Defaults to ''.
  • access: public
string getHtml ()
getHtml_images (line 135)
  • return: An array of embedded images/objects Defaults to null.
  • access: public
mixed getHtml_images ()
getHtml_text (line 119)
  • return: The alternative text to the HTML part (only used in HTML messages) Defaults to ''.
  • access: public
string getHtml_text ()
getImage_types (line 151)
  • return: An array of recognised image types for the findHtmlImages() method Defaults to null.
  • access: public
mixed getImage_types ()
getIs_built (line 215)
  • return: Whether the message has been built or not Defaults to false.
  • access: public
boolean getIs_built ()
getOutput (line 103)
  • return: The main body of the message after building Defaults to ''.
  • access: public
string getOutput ()
getReturn_path (line 231)
  • return: The return path address. If not set the From:address is used instead Defaults to ''.
  • access: public
string getReturn_path ()
getRFC822 (line 1042)

Use this method to return the email in message/rfc822 format. adding an email to another email as an attachment. out example in example.

Use this method to return the email in message/rfc822 format. Useful for adding an email to another email as an attachment. there's a commented out example in example.php.

  • access: public
mixed getRFC822 (mixed $recipients)
  • mixed $recipients
getSmtp_params (line 247)
  • return: Array of information needed for smtp sending Defaults to null.
  • access: public
mixed getSmtp_params ()
getText (line 87)
  • return: The text part of the message(only used in TEXT only messages) Defaults to ''.
  • access: public
string getText ()
init (line 277)

Init

Init

  • access: public
void init (unknown_type $config)
  • unknown_type $config
onInit (line 265)

Raises OnInit event.

Raises OnInit event.

  • access: public
void onInit (TEventParameter $param)
  • TEventParameter $param: event parameter
send (line 934)

Sends the mail.

Sends the mail.

  • access: public
mixed send (array $recipients, [string $type = 'mail'])
  • array $recipients
  • string $type: OPTIONAL
setAttachments (line 191)
  • access: public
void setAttachments (string $value)
  • string $value: Array of attachments
setBcc (line 520)

Accessor to add a Bcc: header

Accessor to add a Bcc: header

  • access: public
void setBcc (string $bcc)
  • string $bcc
setBuild_params (line 175)
  • access: public
void setBuild_params (string $value)
  • string $value: Parameters that affect the build process
setCc (line 509)

Accessor to add a Cc: header

Accessor to add a Cc: header

  • access: public
void setCc (string $cc)
  • string $cc
setCrlf (line 372)

Accessor to set the CRLF style

Accessor to set the CRLF style

  • access: protected
void setCrlf ([string $crlf = "\n"])
  • string $crlf
setFrom (line 489)

Accessor to add a From: header

Accessor to add a From: header

  • access: public
void setFrom (string $from)
  • string $from
setHeadCharset (line 448)

Accessor function to set the header encoding charset

Accessor function to set the header encoding charset

  • access: public
void setHeadCharset ([string $charset = 'ISO-8859-1'])
  • string $charset: Default ISO-8859-1
setHeader (line 469)

Accessor to set a header

Accessor to set a header

  • access: public
void setHeader (string $name, mixed $value)
  • string $name
  • mixed $value
setHeaders (line 207)
  • access: public
void setHeaders (string $value)
  • string $value: The main message headers
setHtml (line 79)
  • access: public
void setHtml (string $value)
  • string $value: The html part of the message
setHtmlCharset (line 438)

Accessor function to set the HTML charset

Accessor function to set the HTML charset

  • access: public
void setHtmlCharset ([string $charset = 'ISO-8859-1'])
  • string $charset: Default ISO-8859-1
setHtmlContent (line 547)

Adds a html part to the mail.

Adds a html part to the mail. Also replaces image names with content-id's.

  • access: public
void setHtmlContent (string $html, [string $text = null], [string $images_dir = null])
  • string $html
  • string $text
  • string $images_dir
setHtmlEncoding (line 418)

Accessor function to set the HTML encoding

Accessor function to set the HTML encoding

  • access: public
void setHtmlEncoding ([string $encoding = 'quoted-printable'])
  • string $encoding: Default quoted-printable
setHtml_images (line 143)
  • access: public
void setHtml_images (mixed $value)
  • mixed $value: An array of embedded images/objects
setHtml_text (line 127)
  • access: public
void setHtml_text (string $value)
  • string $value: The alternative text to the HTML part (only used in HTML messages)
setImage_types (line 159)
  • access: public
void setImage_types (mixed $value)
  • mixed $value: An array of recognised image types for the findHtmlImages() method
setIs_built (line 223)
  • access: public
void setIs_built (boolean $value)
  • boolean $value: Whether the message has been built or not
setOutput (line 111)
  • access: public
void setOutput (string $value)
  • string $value: The main body of the message after building
setReturnPath (line 499)

Accessor to set the return path

Accessor to set the return path

  • access: public
void setReturnPath (string $return_path)
  • string $return_path
setReturn_path (line 239)
  • access: public
void setReturn_path (string $value)
  • string $value: The return path address. If not set the From:address is used instead
setSMTPParams (line 393)

Accessor to set the SMTP parameters

Accessor to set the SMTP parameters

  • access: public
void setSMTPParams ([string $host = null], [integer $port = null], [string $helo = null], [string $auth = null], [string $user = null], [string $pass = null])
  • string $host
  • integer $port
  • string $helo
  • string $auth
  • string $user
  • string $pass
setSmtp_params (line 255)
  • access: public
void setSmtp_params (mixed $value)
  • mixed $value: Array of information needed for smtp sending
setSubject (line 479)

Accessor to add a Subject: header

Accessor to add a Subject: header

  • access: public
void setSubject (string $subject)
  • string $subject
setText (line 95)
  • access: public
void setText (string $value)
  • string $value: The text part of the message(only used in TEXT only messages)
setTextCharset (line 428)

Accessor function to set the text charset

Accessor function to set the text charset

  • access: public
void setTextCharset ([string $charset = 'ISO-8859-1'])
  • string $charset: Default ISO-8859-1
setTextEncoding (line 408)

Accessor function to set the text encoding

Accessor function to set the text encoding

  • access: public
void setTextEncoding ([string $encoding = '7bit'])
  • string $encoding: Default 7bit
setTextWrap (line 458)

Accessor function to set the text wrap count

Accessor function to set the text wrap count

  • access: public
void setTextWrap ([integer $count = 998])
  • integer $count: Default 998
_addAlternativePart (line 699)

Adds an alternative part to a mime_part object

Adds an alternative part to a mime_part object

  • access: protected
mixed _addAlternativePart (mixed &$obj)
  • mixed $obj
_addAttachmentPart (line 749)

Adds an attachment subpart to a mime_part object

Adds an attachment subpart to a mime_part object

  • access: protected
void &_addAttachmentPart (mixed &$obj, mixed $value)
  • mixed $obj
  • mixed $value
_addHtmlImagePart (line 732)

Adds an html image subpart to a mime_part object

Adds an html image subpart to a mime_part object

  • access: protected
void &_addHtmlImagePart (mixed &$obj, mixed $value)
  • mixed $obj
  • mixed $value
_addHtmlPart (line 668)

Adds a html subpart to a mime_part object

Adds a html subpart to a mime_part object

  • access: protected
mixed &_addHtmlPart (mixed &$obj)
  • mixed $obj
_addMixedPart (line 686)

Starts a message with a mixed part

Starts a message with a mixed part

  • access: protected
mixed &_addMixedPart ()
_addRelatedPart (line 716)

Adds a html subpart to a mime_part object

Adds a html subpart to a mime_part object

  • access: protected
mixed &_addRelatedPart (mixed &$obj)
  • mixed $obj
_addTextPart (line 649)

Adds a text subpart to a mime_part object

Adds a text subpart to a mime_part object

  • access: protected
mixed &_addTextPart (mixed &$obj, string $text)
  • mixed $obj
  • string $text
_encodeHeader (line 916)

Function to encode a header if necessary

Function to encode a header if necessary according to RFC2047

  • access: protected
string _encodeHeader (string $input, [string $charset = 'ISO-8859-1'])
  • string $input
  • string $charset: Default ISO-8859-1
_findHtmlImages (line 571)

Function for extracting images from html source. through the html code supplied by add_html() and find any file that ends in one of the extensions defined in $obj->image_types.

Function for extracting images from html source. This function will look through the html code supplied by add_html() and find any file that ends in one of the extensions defined in $obj->image_types. If the file exists it will read it in and embed it, (not an attachment).

  • access: protected
  • author: Dan Allen
void _findHtmlImages (string $images_dir)
  • string $images_dir

Documentation generated on Fri, 27 Jul 2007 11:06:05 -0300 by phpDocumentor 1.3.0RC3