| 123456789101112131415161718192021222324252627282930 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.mail.additional-headers">
- <title>Additional Headers</title>
- <para>
- 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>
- <para>
- To set the Reply-To: header there exists the function
- <methodname>setReplyTo($email, $name=null)</methodname>, because it requires additional
- special escaping of the different parts (email and name).
- </para>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|