1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.mime.part">
4 <title>Zend_Mime_Part</title>
6 <sect2 id="zend.mime.part.introduction">
7 <title>Introduction</title>
10 This class represents a single part of a <acronym>MIME</acronym> message. It contains
11 the actual content of the message part plus information about its encoding,
12 content type and original filename. It provides a method for generating a
13 string from the stored data. <classname>Zend_Mime_Part</classname> objects can be
15 linkend="zend.mime.message"><classname>Zend_Mime_Message</classname></link> to
16 assemble a complete multipart message.
20 <sect2 id="zend.mime.part.instantiation">
21 <title>Instantiation</title>
24 <classname>Zend_Mime_Part</classname> is instantiated with a string that
25 represents the content of the new part. The type is assumed to be
26 OCTET-STREAM, encoding is 8Bit. After instantiating a
27 <classname>Zend_Mime_Part</classname>, meta information can be set by accessing its
31 <programlisting language="php"><![CDATA[
32 public $type = Zend_Mime::TYPE_OCTETSTREAM;
33 public $encoding = Zend_Mime::ENCODING_8BIT;
45 <sect2 id="zend.mime.part.methods">
46 <title>Methods for rendering the message part to a string</title>
49 <methodname>getContent()</methodname> returns the encoded content of the
50 MimePart as a string using the encoding specified in the attribute
51 $encoding. Valid values are Zend_Mime::ENCODING_* Characterset conversions are
56 <methodname>getHeaders()</methodname> returns the Mime-Headers for the
57 MimePart as generated from the information in the publicly accessible
58 attributes. The attributes of the object need to be set correctly before
59 this method is called.
64 <varname>$charset</varname> has to be set to the actual charset of the
65 content if it is a text type (Text or HTML).
70 <varname>$id</varname>
71 may be set to identify a content-id for inline images in a HTML mail.
76 <varname>$filename</varname>
77 contains the name the file will get when downloading it.
82 <varname>$disposition</varname> defines if the file should be treated as an
83 attachment or if it is used inside the (HTML-) mail (inline).
88 <varname>$description</varname>
89 is only used for informational purposes.
94 <varname>$boundary</varname>
95 defines string as boundary.
100 <varname>$location</varname> can be used as resource <acronym>URI</acronym>
101 that has relation to the content.
106 <varname>$language</varname>
107 defines languages in the content.