从早上开始我一直在尝试,但最后我必须把它放在 stackoverflow 上。我一直在尝试通过 php 发送 HTML 邮件,当我看到我的邮件时,我得到的 HTML 代码完全不是设计精美的邮件
<?php
$email = $_POST["email"];
$to = $email;
$from = "arshkapoor2015@gmail.com";
$subject = "Your thebigmall coupon code";
$headers = "From:" . $from;
ob_start();
?>
<html>
<head>
<title></title>
</head>
<body>
<p>
</p>
<div style="font-size: small; width: 797.4166870117188px; background-color: rgb(236, 236, 236); margin: 0px; padding: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; ">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr style="border-collapse: collapse; ">
<td align="center" bgcolor="#ececec" style="border-collapse: collapse; ">
<table border="0" cellpadding="0" cellspacing="0" style="margin: 0px 10px; " width="640">
<tbody>
<tr style="border-collapse: collapse; ">
<td height="20" style="border-collapse: collapse; " width="640">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="640">
<table bgcolor="#00707b" border="0" cellpadding="0" cellspacing="0" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(4, 57, 72); color: rgb(231, 203, 163); " width="640">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="15">
</td>
<td align="left" style="border-collapse: collapse; " valign="middle" width="350">
<table border="0" cellpadding="0" cellspacing="0" width="350">
<tbody>
<tr style="border-collapse: collapse; ">
<td height="8" style="border-collapse: collapse; " width="350">
</td>
</tr>
</tbody>
</table>
<div style="font-size: 12px; ">
<a href="http://www.thebigmall.co.in" style="font-weight: bold; color: rgb(231, 203, 163); text-decoration: none; " target="_blank">Web Version</a></div>
<table border="0" cellpadding="0" cellspacing="0" width="350">
<tbody>
<tr style="border-collapse: collapse; ">
<td height="8" style="border-collapse: collapse; " width="350">
</td>
</tr>
</tbody>
</table>
</td>
<td style="border-collapse: collapse; " width="30">
</td>
<td align="right" style="border-collapse: collapse; " valign="middle" width="255">
<table border="0" cellpadding="0" cellspacing="0" width="255">
<tbody>
<tr style="border-collapse: collapse; ">
<td height="8" style="border-collapse: collapse; " width="255">
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " valign="middle">
<a href="http://preview.createsend3.com/t/j-fb-wukdik-l-t/" rel="cs_facebox" style="font-weight: bold; color: rgb(231, 203, 163); text-decoration: none; " target="_blank"><img alt="Facebook icon" border="0" height="14" src="https://img.createsend1.com/img/templatebuilder/like-glyph.png" style="min-height: auto; line-height: 13px; outline-style: none; display: block; " width="8" /></a></td>
<td style="border-collapse: collapse; " width="3">
</td>
<td style="border-collapse: collapse; " valign="middle">
<div style="font-size: 12px; ">
<a href="http://preview.createsend3.com/t/j-fb-wukdik-l-i/" rel="cs_facebox" style="font-weight: bold; color: rgb(231, 203, 163); text-decoration: none; " target="_blank">Like</a></div>
</td>
<td style="border-collapse: collapse; " width="10">
</td>
<td style="border-collapse: collapse; " valign="middle">
<a href="http://client.forwardtomyfriend.com/j-l-2AD73FFF-wukdik-l-d" lang="en" style="font-weight: bold; color: rgb(231, 203, 163); text-decoration: none; " target="_blank"><img alt="Forward icon" border="0" height="14" src="https://img.createsend1.com/img/templatebuilder/forward-glyph.png" style="min-height: auto; line-height: 13px; outline-style: none; display: block; " width="19" /></a></td>
<td style="border-collapse: collapse; " width="3">
</td>
<td style="border-collapse: collapse; " valign="middle">
<div style="font-size: 12px; ">
<a href="http://client.forwardtomyfriend.com/j-l-2AD73FFF-wukdik-l-h" lang="en" style="font-weight: bold; color: rgb(231, 203, 163); text-decoration: none; " target="_blank">Forward</a></div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="255">
<tbody>
<tr style="border-collapse: collapse; ">
<td height="8" style="border-collapse: collapse; " width="255">
</td>
</tr>
</tbody>
</table>
</td>
<td style="border-collapse: collapse; " width="15">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td align="center" bgcolor="#00707b" style="border-collapse: collapse; " width="640">
<table border="0" cellpadding="0" cellspacing="0" width="640">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td height="30" style="border-collapse: collapse; " width="580">
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td style="border-collapse: collapse; " width="580">
<div align="center">
<p style="color: rgb(231, 203, 163); font-family: 'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif; font-size: 36px; margin-top: 0px; margin-bottom: 30px; ">
<strong>TheBigMall Coupon code !</strong></p>
</div>
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td bgcolor="#ffffff" height="30" style="border-collapse: collapse; " width="640">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td bgcolor="#ffffff" style="border-collapse: collapse; " width="640">
<table border="0" cellpadding="0" cellspacing="0" width="640">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td style="border-collapse: collapse; " width="580">
<table border="0" cellpadding="0" cellspacing="0" width="580">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="580">
<h1 align="left" style="font-size: 18px; line-height: 24px; color: rgb(154, 150, 97); font-weight: bold; margin-top: 0px; margin-bottom: 18px; ">
25% off on modular kitchens (Faizabad Road)</h1>
<div align="left" style="font-size: 13px; line-height: 18px; color: rgb(68, 68, 68); margin-top: 0px; margin-bottom: 18px; ">
<p style="margin-bottom: 15px; ">
<strong>Offer Details</strong></p>
<p style="margin-bottom: 15px; ">
Make your kitchen a beautiful place to cook with RECENT KITCHEN WORLD</p>
<p style="margin-bottom: 15px; ">
Get 25% discount on total billing amount on modular kitchens manufacturing. </p>
<p style="margin-bottom: 15px; ">
Our Products:<br style="line-height: 13px; " />
Marine Ply Shutter (Weather Proof)<br style="line-height: 13px; " />
Marine Ply Carcass (Weather Proof)<br style="line-height: 13px; " />
Acrylic shutter<br style="line-height: 13px; " />
Civil work<br style="line-height: 13px; " />
Chimney<br style="line-height: 13px; " />
150 Colours available</p>
<p style="margin-bottom: 15px; ">
Offer for limited period. So don't leave this opportunity & make your kitchen beautiful !!!</p>
</div>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td height="10" style="border-collapse: collapse; " width="580">
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="580">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="580">
<p align="left" style="font-size: 18px; line-height: 24px; color: rgb(154, 150, 97); font-weight: bold; margin-top: 0px; margin-bottom: 18px; ">
Coupon code !</p>
<div align="left" style="font-size: 13px; line-height: 18px; color: rgb(68, 68, 68); margin-top: 0px; margin-bottom: 18px; ">
<h1 style="margin-bottom: 15px; text-align: center; ">
12345$randstr$randstr2</h1>
<p style="margin-bottom: 15px; ">
</p>
</div>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td height="10" style="border-collapse: collapse; " width="580">
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="580">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="580">
<p align="left" style="font-size: 18px; line-height: 24px; color: rgb(154, 150, 97); font-weight: bold; margin-top: 0px; margin-bottom: 18px; ">
Address :</p>
<div align="left" style="font-size: 13px; line-height: 18px; color: rgb(68, 68, 68); margin-top: 0px; margin-bottom: 18px; ">
<p style="text-align: center; margin-bottom: 15px; ">
Store Address :Kamta Check Post, Faizabad Road, Opp. Kamta Petrol Pump, Lucknow.<br style="line-height: 13px; " />
City :Lucknow<br style="line-height: 13px; " />
Contact No.9415255816, 9721961276, 9918404211<br style="line-height: 13px; " />
<span style="color: rgb(255, 0, 0); ">Offers valid for 48 hours only.</span></p>
</div>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td height="10" style="border-collapse: collapse; " width="580">
</td>
</tr>
</tbody>
</table>
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td bgcolor="#ffffff" height="15" style="border-collapse: collapse; " width="640">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="640">
<table bgcolor="#043948" border="0" cellpadding="0" cellspacing="0" style="border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; background-color: rgb(4, 57, 72); color: rgb(226, 226, 226); " width="640">
<tbody>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td height="30" style="border-collapse: collapse; " width="360">
</td>
<td style="border-collapse: collapse; " width="60">
</td>
<td style="border-collapse: collapse; " width="160">
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td style="border-collapse: collapse; " valign="top" width="360">
<p align="left" style="font-size: 12px; line-height: 15px; margin-top: 0px; margin-bottom: 15px; ">
</p>
<p align="left" style="font-size: 12px; line-height: 15px; margin-top: 0px; margin-bottom: 15px; ">
All Rights Reserved > TheBigMall.co.in - Great discounts in your city</p>
</td>
<td style="border-collapse: collapse; " width="60">
</td>
<td style="border-collapse: collapse; " valign="top" width="160">
<p align="right" style="font-size: 11px; line-height: 16px; margin-top: 0px; margin-bottom: 15px; color: rgb(231, 203, 163); ">
</p>
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td style="border-collapse: collapse; " width="30">
</td>
<td height="15" style="border-collapse: collapse; " width="360">
</td>
<td style="border-collapse: collapse; " width="60">
</td>
<td style="border-collapse: collapse; " width="160">
</td>
<td style="border-collapse: collapse; " width="30">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="border-collapse: collapse; ">
<td height="60" style="border-collapse: collapse; " width="640">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<img border="0" height="1" src="https://createsend3.com/t/j-o-wukdik-l/o.gif" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important; line-height: 13px; outline-style: none; display: block; " width="1" /></div>
<div>
</div>
<p>
</p>
</body>
</html>
<?
$message = ob_get_clean();
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>