小编Ral*_*lph的帖子

添加样式到php html电子邮件

我仔细查看了这个问题,我在此发现的是添加以下内容:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
Run Code Online (Sandbox Code Playgroud)

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Run Code Online (Sandbox Code Playgroud)

我想发送一个时事通讯类型的电子邮件,所以造型真的很重要.我观看的所有视频都只是制作html表格,所以我真的没那么做.我想在我的电子邮件中设置内容的样式.

我现在有这个:

$to = $newsletter_email;
        $subject = 'Thank you for subscribing';
        $message = '
            <html>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title></title>
            <style>
                #email-wrap {
                background: #151515;
                color: #FFF;
                }
            </style>
            </head>
            <body>
                <div id="email-wrap">
                <p>Hi,</p><br>
                <p>Thank you.</p><br>
                <p>Thank you,</p>
                <p>Administration</p>
                </div>
            </body>
            </html>
                ';

                $from = "newsletter@example.com";
                //$Bcc = "example@example.com";

                // To send HTML mail, the Content-type header must …
Run Code Online (Sandbox Code Playgroud)

html css php email phpmailer

5
推荐指数
1
解决办法
8744
查看次数

标签 统计

css ×1

email ×1

html ×1

php ×1

phpmailer ×1