電子郵件下面是我用於發送電子郵件CSS打破HTML表使用PHP
$to = '[email protected]';
$subject = "Edufly Global Studies";
$message = file_get_contents("email_template.html");
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <[email protected]>' . "\r\n";
mail($to,$subject,$message,$headers);
並在文件email_template.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[SUBJECT]</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body style="padding: 15px 100px 15px 100px">
<div class="col-md-6 col-md-offset-3">
<h1>TAT time for stages</h1>
<table class='table table-striped table-bordered'>
<tr>
<th>From Stage</th>
<th>To Stage</th>
<th>TAT Time</th>
</tr>
<tr>
<td>Telecounselling</td>
<td>Counselling</td>
<td>25 days</td>
</tr>
<tr>
<td>Counselling</td>
<td>Documentation</td>
<td>7 days</td>
</tr>
<tr>
<td>Documentation</td>
<td>Offer Application</td>
<td>2 days</td>
</tr>
<tr>
<td>Offer Application</td>
<td>Offer Received (New)</td>
<td>30 days</td>
</tr>
<tr>
<td>Offer Received</td>
<td>Visa Applied</td>
<td>25 days</td>
</tr>
<tr>
<td>Visa Applied</td>
<td>Visa Received (New)</td>
<td>20 days</td>
</tr>
<tr>
<td>Visa Received</td>
<td>Payment</td>
<td>60 days</td>
</tr>
</table>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>
代碼如果我單獨運行HTML代碼,它的自舉表格式像下面的截圖
但在郵件我收到升IKE格式化表格
我this.Please任何人做了哪些錯誤幫我走出這個問題。 在此先感謝。
Obvioulsy從您的CDN css文件將被忽略。使用內聯樣式。 –
同時發送電子郵件使用內聯CSS。嘗試尋找電子郵件模板。 –
我嘗試了內嵌的css too.Now也沒有格式化表格到我的電子郵件 –