gpt4 book ai didi

html - CSS 样式 html 表单

转载 作者:太空宇宙 更新时间:2023-11-04 00:22:39 26 4
gpt4 key购买 nike

我有一个 php 表单,想添加一些 css,这样 HTML 电子邮件就不会是无聊的纯文本。

     $msg  = "<h2><strong>EMAIL SUBMISSION FROM</strong></h2><br>" . 
PHP_EOL;
$msg .= "your website<br>" . PHP_EOL;
$msg .= "-------------------------------------------------<br><br>" .
PHP_EOL . PHP_EOL;
$msg .= "<strong>Name: </strong>" . PHP_EOL;
$msg .= "$name <br>" . PHP_EOL . PHP_EOL;
$msg .= "<strong>Email: </strong>" . PHP_EOL;
$msg .= "$email <br>" . PHP_EOL . PHP_EOL;
$msg .= "<strong>Contact Number: </strong>" . PHP_EOL;
$msg .= "$phone <br>" . PHP_EOL . PHP_EOL;
$msg .= "<strong>Day in: </strong>" . PHP_EOL;
$msg .= "$dayin <br>" . PHP_EOL . PHP_EOL;
$msg .= "<strong>Day out: </strong>" . PHP_EOL;
$msg .= "$dayout <br><br>" . PHP_EOL . PHP_EOL;
$msg .= "<strong>Notes / Comments: </strong><br>" . PHP_EOL;
$msg .= "$comments" . PHP_EOL . PHP_EOL;

如何使“EMAIL SUBMISSION FROM”的颜色/字体不同?我试过了 <span style="color:#FF0000;">EMAIL SUBMISSION FROM</span>那是行不通的

我的标题:

    $headers = "From: $email" . PHP_EOL;
$headers .= "Reply-To: $email" . PHP_EOL;
$headers .= "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-type: text/html; charset=utf-8" . PHP_EOL;
$headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;

我不确定 header 中是否需要更改任何内容?

此外,在我的 contact.php 文件的顶部是 if (!defined("PHP_EOL")) define("PHP_EOL", "\r\n");这必须保持不变吗?


编辑

  $msg = "<html><body>
<strong>EMAIL SUBMISSION FROM</strong><br>
your website<br>
------------------------------------------------------<br><br>
<strong>Name: </strong>
$name <br>
<strong>Email: </strong>
$email <br>
<strong>Contact Number: </strong>
$phone <br>
<strong>Day in: </strong>
$dayin <br>
<strong>Day out: </strong>
$dayout <br><br>
<strong>Notes / Comments: </strong><br>
$comments
</body></html>";

最佳答案

我在这里找到了一个用 css 发送电子邮件的例子: http://css-tricks.com/2866-sending-nice-html-email-with-php/

希望它能解决您的问题:)。

关于html - CSS 样式 html 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8412533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com