<?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 <acronym>MIME</acronym> 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>
            <methodname>getContent()</methodname> 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>
            <methodname>getHeaders()</methodname> 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>
                        <varname>$charset</varname> has to be set to the actual charset of the
                        content if it is a text type (Text or <acronym>HTML</acronym>).
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$id</varname> may be set to identify a content-id for inline images
                        in a <acronym>HTML</acronym> mail.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$filename</varname>
                        contains the name the file will get when downloading it.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$disposition</varname> defines if the file should be treated as an
                        attachment or if it is used inside the (HTML-) mail (inline).
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$description</varname>
                        is only used for informational purposes.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$boundary</varname>
                        defines string as boundary.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$location</varname> can be used as resource <acronym>URI</acronym>
                        that has relation to the content.
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <varname>$language</varname>
                        defines languages in the content.
                    </para>
                </listitem>
            </itemizedlist>
        </para>
    </sect2>
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
