Mail_Mime
[ class tree: Mail_Mime ] [ index: Mail_Mime ] [ all elements ]

Class: Mail_mimePart

Source Location: /Mail_Mime-1.8.8/Mail/mimePart.php

Class Overview


The Mail_mimePart class is used to create MIME E-mail messages


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2003-2006 PEAR <pear-group@php.net>

Methods


Inherited Variables

Inherited Methods


Class Details

[line 76]
The Mail_mimePart class is used to create MIME E-mail messages

This class enables you to manipulate and build a mime email from the ground up. The Mail_Mime class is a userfriendly api to this class for people who aren't interested in the internals of mime mail. This class however allows full control over the email.



[ Top ]


Method Detail

Mail_mimePart (Constructor)   [line 165]

Mail_mimePart Mail_mimePart( [string $body = ''], [array $params = array()])

Constructor.

Sets up the object.

  • Access: public

Parameters:

string   $body     The body of the mime part if any.
array   $params     An associative array of optional parameters: content_type - The content type for this part eg multipart/mixed encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable charset - Content character set cid - Content ID to apply disposition - Content disposition, inline or attachment filename - Filename parameter for content disposition description - Content description name_encoding - Encoding of the attachment name (Content-Type) By default filenames are encoded using RFC2231 Here you can set RFC2047 encoding (quoted-printable or base64) instead filename_encoding - Encoding of the attachment filename (Content-Disposition) See 'name_encoding' headers_charset - Charset of the headers e.g. filename, description. If not set, 'charset' will be used eol - End of line sequence. Default: "\r\n" headers - Hash array with additional part headers. Array keys can be in form of <header_name>:<parameter_name> body_file - Location of file with part's body (instead of $body)

[ Top ]

addSubpart   [line 465]

Mail_mimePart &addSubpart( string $body, array $params)

Adds a subpart to current mime part and returns a reference to it
  • Return: A reference to the part you just added. In PHP4, it is crucial if using multipart/* in your subparts that you use =& in your script when calling this function, otherwise you will not be able to add further subparts.
  • Access: public

Parameters:

string   $body     The body of the subpart, if any.
array   $params     The parameters for the subpart, same as the $params argument for constructor.

[ Top ]

encode   [line 303]

An encode( [string $boundary = null])

Encodes and returns the email. Also stores it in the encoded member variable
  • Return: associative array containing two elements, body and headers. The headers element is itself an indexed array. On error returns PEAR error object.
  • Access: public

Parameters:

string   $boundary     Pre-defined boundary string

[ Top ]

encodeHeader   [line 810]

string encodeHeader( string $name, string $value, [string $charset = 'ISO-8859-1'], [string $encoding = 'quoted-printable'], [string $eol = "\r\n"])

Encodes a header as per RFC2047
  • Return: Encoded header data (without a name)
  • Since: 1.6.1
  • Access: public

Parameters:

string   $name     The header name
string   $value     The header data to encode
string   $charset     Character set name
string   $encoding     Encoding name (base64 or quoted-printable)
string   $eol     End-of-line sequence. Default: "\r\n"

[ Top ]

encodeHeaderValue   [line 982]

string encodeHeaderValue( string $value, string $charset, string $encoding, [int $prefix_len = 0], [string $eol = "\r\n"])

Encodes a header value as per RFC2047
  • Return: Encoded header data
  • Since: 1.6.1
  • Access: public

Parameters:

string   $value     The header data to encode
string   $charset     Character set name
string   $encoding     Encoding name (base64 or quoted-printable)
int   $prefix_len     Prefix length. Default: 0
string   $eol     End-of-line sequence. Default: "\r\n"

[ Top ]

encodeMB   [line 1112]

string encodeMB( string $str, string $charset, string $encoding, [int $prefix_len = 0], [string $eol = "\r\n"])

Encodes the given string using base64 or quoted-printable.

This method makes sure that encoded-word represents an integral number of characters as per RFC2047.

  • Return: Encoded string
  • Since: 1.8.0
  • Access: public

Parameters:

string   $str     String to encode
string   $charset     Character set name
string   $encoding     Encoding name (base64 or quoted-printable)
int   $prefix_len     Prefix length. Default: 0
string   $eol     End-of-line sequence. Default: "\r\n"

[ Top ]

encodeQP   [line 1082]

string encodeQP( string $str)

Encodes the given string using quoted-printable
  • Return: Encoded string
  • Since: 1.6.0
  • Access: public

Parameters:

string   $str     String to encode

[ Top ]

encodeToFile   [line 368]

array encodeToFile( string $filename, [string $boundary = null], [boolean $skip_head = false])

Encodes and saves the email into file. File must exist.

Data will be appended to the file.

  • Return: An associative array containing message headers or PEAR error object
  • Since: 1.6.0
  • Access: public

Parameters:

string   $filename     Output file location
string   $boundary     Pre-defined boundary string
boolean   $skip_head     True if you don't want to save headers

[ Top ]


Documentation generated on Fri, 05 Jul 2013 11:00:05 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.