File: Zend_Mail-HtmlMails.xml

package info (click to toggle)
zendframework 1.12.9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 133,584 kB
  • sloc: xml: 1,311,829; php: 570,173; sh: 170; makefile: 125; sql: 121
file content (29 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: 24249 -->
<!-- Reviewed: no -->
<sect1 id="zend.mail.html-mails">
    <title>HTML E-Mail</title>

    <para>
        Um einen E-Mail im <acronym>HTML</acronym> Format zu versenden, muss der Hauptteil der
        Nachricht durch die <methodname>setBodyHTML()</methodname> statt durch die
        <methodname>setBodyText()</methodname> gesetzt werden. Der <acronym>MIME</acronym>
        Inhaltstyp wird dann automatisch auf <property>text/html</property> gesetzt. Wenn du sowohl
        <acronym>HTML</acronym> als auch Text Daten verwendest, wird automatisch eine
        multipart/alternative <acronym>MIME</acronym> E-Mail erstellt:
    </para>

    <example id="zend.mail.html-mails.example-1">
        <title>Versand von HTML E-Mail</title>

        <programlisting language="php"><![CDATA[
$mail = new Zend_Mail();
$mail->setBodyText('Mein netter Test Text');
$mail->setBodyHtml('Mein netter <b>Test</b> Text');
$mail->setFrom('somebody@example.com', 'Ein Versender');
$mail->addTo('somebody_else@example.com', 'Ein Empfänger');
$mail->setSubject('TestBetreff');
$mail->send();
]]></programlisting>
    </example>
</sect1>