| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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:
- -->
|