Zend_Mail-HtmlMails.xml 1.0 KB

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.mail.html-mails">
  4. <title>HTML E-Mail</title>
  5. <para>
  6. To send an e-mail in HTML format, set the body using the method <methodname>setBodyHTML()</methodname> instead of
  7. <methodname>setBodyText()</methodname>. The <acronym>MIME</acronym> content type will automatically be set to <code>text/html</code>
  8. then. If you use both HTML and Text bodies, a multipart/alternative <acronym>MIME</acronym> message will automatically be
  9. generated:
  10. </para>
  11. <example id="zend.mail.html-mails.example-1">
  12. <title>Sending HTML E-Mail</title>
  13. <programlisting language="php"><![CDATA[
  14. $mail = new Zend_Mail();
  15. $mail->setBodyText('My Nice Test Text');
  16. $mail->setBodyHtml('My Nice <b>Test</b> Text');
  17. $mail->setFrom('somebody@example.com', 'Some Sender');
  18. $mail->addTo('somebody_else@example.com', 'Some Recipient');
  19. $mail->setSubject('TestSubject');
  20. $mail->send();
  21. ]]></programlisting>
  22. </example>
  23. </sect1>
  24. <!--
  25. vim:se ts=4 sw=4 et:
  26. -->