| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.mime.part">
- <title>Zend_Mime_Part</title>
- <sect2 id="zend.mime.part.introduction">
- <title>Introduction</title>
- <para>This class represents a single part of a MIME message. It contains the
- actual content of the message part plus information about its encoding,
- content type and original filename. It provides a method for generating a
- string from the stored data. <classname>Zend_Mime_Part</classname> objects can be
- added to <link
- linkend="zend.mime.message"><classname>Zend_Mime_Message</classname></link> to
- assemble a complete multipart message.</para>
- </sect2>
- <sect2 id="zend.mime.part.instantiation">
- <title>Instantiation</title>
- <para><classname>Zend_Mime_Part</classname> is instantiated with a string that
- represents the content of the new part. The type is assumed to be
- OCTET-STREAM, encoding is 8Bit. After instantiating a
- <classname>Zend_Mime_Part</classname>, meta information can be set by accessing its
- attributes directly:</para>
- <programlisting language="php"><![CDATA[
- public $type = Zend_Mime::TYPE_OCTETSTREAM;
- public $encoding = Zend_Mime::ENCODING_8BIT;
- public $id;
- public $disposition;
- public $filename;
- public $description;
- public $charset;
- public $boundary;
- public $location;
- public $language;
- ]]></programlisting>
- </sect2>
- <sect2 id="zend.mime.part.methods">
- <title>Methods for rendering the message part to a string</title>
- <para><code>getContent()</code> returns the encoded content of the
- MimePart as a string using the encoding specified in the attribute
- $encoding. Valid values are Zend_Mime::ENCODING_* Characterset conversions are
- not performed.</para>
- <para>
- <code>getHeaders()</code> returns the Mime-Headers for the
- MimePart as generated from the information in the publicly accessible
- attributes. The attributes of the object need to be set correctly before
- this method is called.
- <itemizedlist>
- <listitem>
- <para>
- <code>$charset</code>
- has to be set to the actual charset of the content if it is a text type (Text or HTML).
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$id</code>
- may be set to identify a content-id for inline images in a HTML mail.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$filename</code>
- contains the name the file will get when downloading it.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$disposition</code>
- defines if the file should be treated as an attachment or if it is used inside
- the (HTML-) mail (inline).
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$description</code>
- is only used for informational purposes.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$boundary</code>
- defines string as boundary.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$location</code>
- can be used as resource URI that has relation to the content.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>$language</code>
- defines languages in the content.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|