Zend_Mail-AdditionalHeaders.xml 1.1 KB

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.mail.additional-headers">
  4. <title>Additional Headers</title>
  5. <para>
  6. Arbitrary mail headers can be set by using the <code>addHeader()</code> method. It requires two
  7. parameters containing the name and the value of the header field. A third optional parameter determines
  8. if the header should have only one or multiple values:
  9. </para>
  10. <example id="zend.mail.additional-headers.example-1">
  11. <title>Adding E-Mail Message Headers</title>
  12. <programlisting language="php"><![CDATA[
  13. $mail = new Zend_Mail();
  14. $mail->addHeader('X-MailGenerator', 'MyCoolApplication');
  15. $mail->addHeader('X-greetingsTo', 'Mom', true); // multiple values
  16. $mail->addHeader('X-greetingsTo', 'Dad', true);
  17. ]]></programlisting>
  18. </example>
  19. <para>To set the Reply-To: header there exists the function <code>setReplyTo($email, $name=null)</code>,
  20. because it requires additional special escaping of the different parts (email and name).</para>
  21. </sect1>
  22. <!--
  23. vim:se ts=4 sw=4 et:
  24. -->