gmail仍然用php mail()显示html标签;

时间:2015-01-29 13:01:42

标签: php html email sendmail

我在这个网站和php.net网站上查了哪些标签,我应该发送我的php mail()函数来正确发送html邮件。不知怎的,我的gmail仍然显示html标签。我在这方面做错了什么?

$to = "$email";
        $subject = "order placed";
        $from = "noreply@snorgytees.tk";
        $message = "

        Hi, '{$_SESSION['naam']}';
        <html>
        <head>
        </head>
        <body>
        <table>
                <tr>

                <td>$Artikelnaam></td>
                <td>$maat</td>
                <td>$hoeveelheid</td>
                <td>$$echteprijs</td>
                <td>Total: $$totaalprijs;
            <br><br>Total including VAT: $$prijs_btw</td>
                </tr>

        </table>
        </body>
        </html>
        ";  
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'To: $_POST["email"]' . "\r\n";
        $headers .= 'From: noreply@snorgytees.tk' . "\r\n";
        mail($to, $subject, $from, $message, $headers);

1 个答案:

答案 0 :(得分:0)

一周前我遇到了同样的问题,这个问题帮我解决了。 gmail does not render html in email