1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.mime.mime">
4 <title>Zend_Mime</title>
6 <sect2 id="zend.mime.mime.introduction">
7 <title>Introduction</title>
10 <classname>Zend_Mime</classname> is a support class for handling multipart
11 <acronym>MIME</acronym> messages. It is used by <link
12 linkend="zend.mail"><classname>Zend_Mail</classname></link> and <link
13 linkend="zend.mime.message"><classname>Zend_Mime_Message</classname></link> and may
14 be used by applications requiring <acronym>MIME</acronym> support.
18 <sect2 id="zend.mime.mime.static">
19 <title>Static Methods and Constants</title>
22 <classname>Zend_Mime</classname> provides a simple set of static helper methods to work
23 with <acronym>MIME</acronym>:
28 <methodname>Zend_Mime::isPrintable()</methodname>: Returns
29 <constant>TRUE</constant> if the given string contains no unprintable
30 characters, <constant>FALSE</constant> otherwise.
36 <methodname>Zend_Mime::encode()</methodname>: Encodes a string with
43 <methodname>Zend_Mime::encodeBase64()</methodname>: Encodes a string into
50 <methodname>Zend_Mime::encodeQuotedPrintable()</methodname>: Encodes a
51 string with the quoted-printable mechanism.
57 <methodname>Zend_Mime::encodeBase64Header()</methodname>: Encodes a string
58 into base64 encoding for Mail Headers.
64 <methodname>Zend_Mime::encodeQuotedPrintableHeader()</methodname>: Encodes
65 a string with the quoted-printable mechanism for Mail Headers.
72 <classname>Zend_Mime</classname> defines a set of constants commonly used with
73 <acronym>MIME</acronym> Messages:
78 <constant>Zend_Mime::TYPE_OCTETSTREAM</constant>: 'application/octet-stream'
84 <constant>Zend_Mime::TYPE_TEXT</constant>: 'text/plain'
90 <constant>Zend_Mime::TYPE_HTML</constant>: 'text/html'
96 <constant>Zend_Mime::ENCODING_7BIT</constant>: '7bit'
102 <constant>Zend_Mime::ENCODING_8BIT</constant>: '8bit'
108 <constant>Zend_Mime::ENCODING_QUOTEDPRINTABLE</constant>: 'quoted-printable'
114 <constant>Zend_Mime::ENCODING_BASE64</constant>: 'base64'
120 <constant>Zend_Mime::DISPOSITION_ATTACHMENT</constant>: 'attachment'
126 <constant>Zend_Mime::DISPOSITION_INLINE</constant>: 'inline'
132 <constant>Zend_Mime::MULTIPART_ALTERNATIVE</constant>:
133 'multipart/alternative'
139 <constant>Zend_Mime::MULTIPART_MIXED</constant>: 'multipart/mixed'
145 <constant>Zend_Mime::MULTIPART_RELATED</constant>: 'multipart/related'
152 <sect2 id="zend.mime.mime.instantiation">
153 <title>Instantiating Zend_Mime</title>
156 When Instantiating a <classname>Zend_Mime</classname> Object, a <acronym>MIME</acronym>
157 boundary is stored that is used for all subsequent non-static method calls on that
158 object. If the constructor is called with a string parameter, this value
159 is used as a <acronym>MIME</acronym> boundary. If not, a random <acronym>MIME</acronym>
160 boundary is generated during construction time.
164 A <classname>Zend_Mime</classname> object has the following Methods:
169 <methodname>boundary()</methodname>: Returns the <acronym>MIME</acronym>
176 <methodname>boundaryLine()</methodname>: Returns the complete
177 <acronym>MIME</acronym> boundary line.
183 <methodname>mimeEnd()</methodname>: Returns the complete
184 <acronym>MIME</acronym> end boundary line.