在 sendmail php 中,如果我们填写并单击提交按钮,我会创建表 n,邮件将成功接收。我尝试了一些我在下面显示的示例代码,但它会打印除引号之外的所有 html 代码。现在我想添加一些样式,例如表格或粗斜体,或者在“$message”区域的邮件正文中添加图像......有人可以帮忙吗?
<?php
ob_start();
$to = "me@mymail.com";
$subject = "Request mail";
$message = "<html><body>";
$message .= '<img src="Images/Logos/Logo_color.png" alt="Logo" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" .$Name.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>Company Name:</strong> </td><td>" .$Company.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>Mobil Number:</strong> </td><td>" .$Mobile.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>Email Id:</strong> </td><td>" .$Email.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>Address):</strong> </td><td>" .$Address.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>State:</strong> </td><td>" .$State.PHP_EOL. "</td></tr>";
$message .= "<tr><td><strong>Edition:</strong> </td><td>" .$Edition."</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
$from = "mail@yourdomain.co.in";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
header('Location: http://yourdomain.co.in') ;
?>