我在一个网站上有一个表格,允许用户输入他们的姓名、电话、电子邮件等。当我收到此信息作为电子邮件时,它完全没有格式化,因此阅读起来有点困难。见下图:
有没有办法可以使用 CSS 来设置它的样式,即。使 From 和 email 标题加粗{font-weight:bold;}
?
我用于表单的 php 是:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$formcontent ="From: $name \n Email: $email \n Phone: $phone \n Message: $message";
$recipient = "studio@ll-i.co.uk";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "<p>Thanks for getting in touch, we'll get back to you shortly..</p>";
?>