| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.mail.additional-headers">
- <title>Additional Headers</title>
- <para>
- <classname>Zend_Mail</classname> provides several methods to set additional Mail Headers:
- <itemizedlist>
- <listitem>
- <para>
- <methodname>setReplyTo($email, $name=null)</methodname>: sets the Reply-To:
- header.
- </para>
- </listitem>
- <listitem>
- <para>
- <methodname>setDate($date = null)</methodname>: sets the Date: header.
- This method uses current time stamp by default. Or You can pass time stamp,
- date string or <classname>Zend_Date</classname> instance to this method.
- </para>
- </listitem>
- <listitem>
- <para>
- <methodname>setMessageId($id = true)</methodname>: sets the Message-Id: header.
- This method can generate message ID automatically by default. Or You can pass
- your message ID string to this method.
- This method call <methodname>createMessageId()</methodname> internally.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <note>
- <title>Return-Path</title>
- <para>
- If you set Return-Path on your mail, see <link linkend="zend.mail.introduction.sendmail"
- >Configuring sendmail transport</link>.
- Unfortunately, <methodname>setReturnPath($email)</methodname> method does not perform
- this purpose.
- </para>
- </note>
- <para>
- Furthermore, arbitrary mail headers can be set by using the
- <methodname>addHeader()</methodname> method. It requires two parameters containing the name
- and the value of the header field. A third optional parameter determines if the header
- should have only one or multiple values:
- </para>
- <example id="zend.mail.additional-headers.example-1">
- <title>Adding E-Mail Message Headers</title>
- <programlisting language="php"><![CDATA[
- $mail = new Zend_Mail();
- $mail->addHeader('X-MailGenerator', 'MyCoolApplication');
- $mail->addHeader('X-greetingsTo', 'Mom', true); // multiple values
- $mail->addHeader('X-greetingsTo', 'Dad', true);
- ]]></programlisting>
- </example>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|