Class Mail_Mime

Description

Located in /classes/mail/mime.class.php (line 25)


	
			
Variable Summary
array $attachments
array $headers
string $html
array $html_images
string $html_text
string $images_dir
array $image_types
boolean $is_built
string $output
string $return_path
array $smtp_params
string $text
Method Summary
Mail_Mime Mail_Mime ()
void addAttachment (unknown_type $file, [unknown_type $name = ''], [unknown_type $c_type = 'application/octet-stream'], [unknown_type $encoding = 'base64'])
void addHtmlImage (unknown_type $file, [unknown_type $name = ''], [unknown_type $c_type = 'application/octet-stream'])
void buildMessage ([mixed $params = array()])
void cleanHeaders (mixed $sStr)
mixed send (array $recipients, [string $type = 'mail'])
void setBcc (string $bcc)
void setCc (string $cc)
void setCrlf ([string $crlf = "\n"])
void setFrom (string $from)
void setHeadCharset ([string $charset = 'UTF-8'])
void setHeader (string $name, string $value)
void setHtml (string $html, [string $text = null], [string $images_dir = null])
void setHtmlCharset ([string $charset = 'UTF-8'])
void setHtmlEncoding ([string $encoding = 'quoted-printable'])
void setReturnPath (string $return_path)
void setSMTPParams ([mixed $host = null], [mixed $port = null], [mixed $helo = null], [mixed $auth = null], [mixed $user = null], [mixed $pass = null])
void setSubject (string $subject)
void setText ([string $text = ''])
void setTextCharset ([string $charset = 'UTF-8'])
void setTextEncoding ([string $encoding = '7bit'])
void setTextWrap ([int $count = 998])
unknown &_addAlternativePart (unknown_type &$obj)
void _addAttachmentPart (unknown_type &$obj, unknown_type $value)
void _addHtmlImagePart (unknown_type &$obj, unknown_type $value)
unknown &_addHtmlPart (unknown_type &$obj)
unknown &_addMixedPart ()
unknown &_addRelatedPart (unknown_type &$obj)
unknown &_addTextPart (unknown_type &$obj, unknown_type $text)
void _encodeHeader (mixed $input, [mixed $charset = 'UTF-8'])
void _findHtmlImages (string $images_dir)
Variables
array $attachments (line 79)

Array of attachments

array $build_params (line 73)

Parameters that affect the build process

array $headers (line 85)

The main message headers

string $html (line 31)

The html part of the message

array $html_images (line 55)

An array of embedded images/objects

string $html_text (line 49)

The alternative text to the HTML part (only used in HTML messages)

string $images_dir (line 67)

Default image dir for function setHtml

array $image_types (line 61)

An array of recognised image types for the findHtmlImages() method

boolean $is_built (line 91)

Whether the message has been built or not

string $output (line 43)

The main body of the message after building

string $return_path (line 97)

The return path address.

array $smtp_params (line 103)

Array of information needed for smtp sending

string $text (line 37)

The text part of the message(only used in TEXT only messages)

Methods
Constructor Mail_Mime (line 109)

Constructor function. Sets the headers if supplied.

Mail_Mime Mail_Mime ()
addAttachment (line 372)

Adds a file to the list of attachments.

void addAttachment (unknown_type $file, [unknown_type $name = ''], [unknown_type $c_type = 'application/octet-stream'], [unknown_type $encoding = 'base64'])
  • unknown_type $file
  • unknown_type $name
  • unknown_type $c_type
  • unknown_type $encoding
addHtmlImage (line 355)

Adds an image to the list of embedded images.

void addHtmlImage (unknown_type $file, [unknown_type $name = ''], [unknown_type $c_type = 'application/octet-stream'])
  • unknown_type $file
  • unknown_type $name
  • unknown_type $c_type
buildMessage (line 504)

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: 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 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 text_wrap - The character count at which to wrap 7bit encoded data. Default this is 998. html_charset - The character set to use for a html section. Default is ISO-8859-1 text_charset - The character set to use for a text section. Default is ISO-8859-1 head_charset - The character set to use for header encoding should it be needed. Default is ISO-8859-1

void buildMessage ([mixed $params = array()])
cleanHeaders (line 650)
void cleanHeaders (mixed $sStr)
send (line 667)

Sends the mail.

mixed send (array $recipients, [string $type = 'mail'])
  • array $recipients
  • string $type: OPTIONAL
setBcc (line 278)

Set `Bcc`

void setBcc (string $bcc)
  • string $bcc: BCC
setCc (line 270)

Set `Cc`

void setCc (string $cc)
  • string $cc: CC
setCrlf (line 163)

Set the CRLF style

void setCrlf ([string $crlf = "\n"])
  • string $crlf: new CRLF
setFrom (line 254)

Set `From`

void setFrom (string $from)
  • string $from: from value
setHeadCharset (line 221)

Set the header encoding charset

void setHeadCharset ([string $charset = 'UTF-8'])
  • string $charset: charset for HTML (ISO-8859-1 by default)
setHeader (line 238)

Set a header

void setHeader (string $name, string $value)
  • string $name: header name
  • string $value: header value
setHtml (line 299)

Adds a html part to the mail.

Also replaces image names with content-id's.

void setHtml (string $html, [string $text = null], [string $images_dir = null])
  • string $html: html code of message
  • string $text: text variant of message
  • string $images_dir: directory with images
setHtmlCharset (line 213)

Set the HTML charset

void setHtmlCharset ([string $charset = 'UTF-8'])
  • string $charset: charset for HTML (ISO-8859-1 by default)
setHtmlEncoding (line 197)

Set the HTML encoding

void setHtmlEncoding ([string $encoding = 'quoted-printable'])
  • string $encoding: text encoding (7biy, quote-printable etc.)
setReturnPath (line 262)

Set `return-path`

void setReturnPath (string $return_path)
  • string $return_path: return path
setSMTPParams (line 176)

Set the SMTP parameters

void setSMTPParams ([mixed $host = null], [mixed $port = null], [mixed $helo = null], [mixed $auth = null], [mixed $user = null], [mixed $pass = null])
setSubject (line 246)

Set `Subject`

void setSubject (string $subject)
  • string $subject: subject
setText (line 288)

Adds plain text. Use this function

when sending non-html email (text-only)

void setText ([string $text = ''])
  • string $text: message text
setTextCharset (line 205)

Set the text charset

void setTextCharset ([string $charset = 'UTF-8'])
  • string $charset: charset for text (ISO-8859-1 by default)
setTextEncoding (line 189)

Set the text encoding

void setTextEncoding ([string $encoding = '7bit'])
  • string $encoding: text encoding (7biy, quote-printable etc.)
setTextWrap (line 229)

Set the text wrap count

void setTextWrap ([int $count = 998])
  • int $count: number of symbols to wrap
_addAlternativePart (line 432)

Adds an alternative part to a mime_part object

unknown &_addAlternativePart (unknown_type &$obj)
  • unknown_type $obj
_addAttachmentPart (line 476)

Adds an attachment subpart to a mime_part object

void _addAttachmentPart (unknown_type &$obj, unknown_type $value)
  • unknown_type $obj
  • unknown_type $value
_addHtmlImagePart (line 462)

Adds an html image subpart to a mime_part object

void _addHtmlImagePart (unknown_type &$obj, unknown_type $value)
  • unknown_type $obj
  • unknown_type $value
_addHtmlPart (line 404)

Adds a html subpart to a mime_part object

unknown &_addHtmlPart (unknown_type &$obj)
  • unknown_type $obj
_addMixedPart (line 421)

Starts a message with a mixed part

unknown &_addMixedPart ()
_addRelatedPart (line 447)

Adds a html subpart to a mime_part object

unknown &_addRelatedPart (unknown_type &$obj)
  • unknown_type $obj
_addTextPart (line 387)

Adds a text subpart to a mime_part object

unknown &_addTextPart (unknown_type &$obj, unknown_type $text)
  • unknown_type $obj
  • unknown_type $text
_encodeHeader (line 639)

Function to encode a header if necessary

according to RFC2047

void _encodeHeader (mixed $input, [mixed $charset = 'UTF-8'])
_findHtmlImages (line 318)

Function for extracting images from html source.

This function will look through the html code supplied by add_html() and find inside html-tags 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).

void _findHtmlImages (string $images_dir)
  • string $images_dir: directory with images

Documentation generated on Fri, 28 Dec 2007 21:35:35 +0100 by phpDocumentor 1.3.0RC3