Zend_Mail-AdditionalHeaders.xml 1.1 KB

123456789101112131415161718192021222324252627282930
  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 <methodname>addHeader()</methodname> method.
  7. It requires two parameters containing the name and the value of the header field. A third
  8. optional parameter determines 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>
  20. To set the Reply-To: header there exists the function
  21. <methodname>setReplyTo($email, $name=null)</methodname>, because it requires additional
  22. special escaping of the different parts (email and name).
  23. </para>
  24. </sect1>
  25. <!--
  26. vim:se ts=4 sw=4 et:
  27. -->