我没有使用PHP获得邮件内容的风格

时间:2014-09-25 08:12:02

标签: php

我没有使用PHP获得邮件内容的样式。我的代码是belo.I邮件没有内容风格。我只有html视图。我不完全在这些页面中包含样式。包括邮件样式content.Any身体帮助。

 <?php
 // multiple recipients
 $to  = 'sender@gmail.com'; // note the comma

 // subject
 $subject = 'Birthday Reminders for August';

 // message
 $message = '
<html dir="ltr" lang="en" class="no-js">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width" />

<title>Zamisoft Invoice</title>
 <style type="text/css">
     #invoice {
  position: relative;
 padding: 18px;
 max-width: 840px;
margin: auto;
background: #f5f5f5;
border: 10px solid #fff;
-webkit-box-shadow: 0 0 1px #888888;
-moz-box-shadow: 0 0 1px #888888;
-o-box-shadow: 0 0 1px #888888;
box-shadow: 0 0 1px #888888;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
 box-sizing: border-box;
 }


  </style>



<!-- give life to HTML5 objects in IE -->
<!--[if lte IE 8]>
   <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"> 
  </script>  <![endif]-->

<!-- js HTML class -->
<script>(function(H)
 {H.className=H.className.replace(/\bno-js\b/,"js")}) 
 (document.documentElement) </script>

</head>
<body>
 <!-- begin markup -->

<div id="invoice" class="paid">

   <header id="header">
    <div class="invoice-intro">
        <img src="logo.png">

    </div>

    <dl class="invoice-meta">
        <dt class="invoice-number">Customer Name</dt>
          <dd>6859</dd>
        <dt class="invoice-number">Reseller Name</dt>
        <dd>6859</dd>
        <dt class="invoice-number">Brand Name</dt>
        <dd>6859</dd>
        <dt class="invoice-number">Country</dt>
        <dd>6859</dd>
        <dt class="invoice-number">Group</dt>
         <dd>6859</dd>
        <dt class="invoice-number">Rate</dt>
        <dd>6859</dd>
    </dl>
 </header>
<!-- e: invoice header -->


<section id="parties">

<div class="invoice-pay">
            <h5 class="style1">Your Current Due</h5>
<br>

            <div class="box2">
        this cat is a hybrid of domestic and wild breeds :)
    </div>
    <div class="box3">
        this cat is a hybrid of domestic and wild breeds :)
    </div>
        </div>

  </section><!-- e: invoice partis -->

 <hr>
<section class="invoice-financials">

     <div class="invoice-items">
        <table width="637">
            <caption>
             Openning Balance<br>
            <br>
            from to
              </caption>
             <thead>
                <tr>
                    <th width="10%" style=" border-right:#003399 solid 1px;">
  Date</th>
                   <th width="32%" style="
   border-right:#003399 solid    1px;">Description</th>
                   <th width="24%" 
   style=" border-right:#003399 solid    1px;">Particulars</th>
                   <th width="14%" style=" border-right:#003399 solid 1px;">Credit</th>
                   <th width="10%" style=" border-right:#003399 solid 1px;">Sale</th>
                   <th width="10%" style=" border-right:#003399 
     solid 1px;">Price      (GPL)</th>
              </tr>
             </thead>
             <tbody>
                <tr>
                    <th style=" border-right:#003399 solid 1px;">
    07-02-2014</th>
                     <th style=" border-right:#003399 solid 1px;">
     1000 aed 2-02-2014 3:45 pm </th>
                    <th style=" border-right:#003399 solid 1px;">
   iccic bank ernakulam mg</th>
                     <th style=" border-right:#003399 solid 1px;">credit</th>
                    <td style=" border-right:#003399 solid 1px;">10000</td>
                     $36,000</td>
          </tr>
                <tr>
                    <th>Romulan Troops</th>
                    <th>1</th>
                     <th>1</th>
                    <th>1</th>
                    <td>10</td>
                    <td>$7,650</td>
                </tr>
                <tr>
                     <th>Kestrel-class Shuttle</th>
                    <th>1</th>
                    <th>1</th>
                    <th>1</th>
                    <td>1</td>
                     <td>$10,220</td>
                </tr>
                  <tr>
                    <th>Clocking Device</th>
                    < th>1</th>
                     <th>1</th>
                      <th>1</th>
                    <td>1</td>
                    <td>$50,000</td>
                  </tr>
            </tbody>
             <tfoot>
                <tr>
                      <td>Amounts in bars of Gold Pressed Latinum</td>
                     <td>&nbsp;</td>
                     <td>&nbsp;</td>
                     <td>&nbsp;</td>
                     <td>&nbsp;</td>
                     <td>&nbsp;</td>
                </tr>
              </tfoot>
         </table>
    </div><!-- e: invoice items -->


       <div class="invoice-totals">
        <table>
              <caption>Totals:</caption>
            <tbody>
                <tr>
                    <th>Subtotal:</th>
                    <td></td>
                      <td>$103,850</td>
                </tr>
                 <tr>
                     <th>Tax:</th>
                    <td>5%</td>
                    <td>$5,192</td>
                </tr>
                 <tr>
                    <th>Total:</th>
                    <  td></td>
                    < td>$109,042</td>
                </tr>
            </tbody>
           </table>


     </div><!-- e: invoice totals -->


    <div class="invoice-notes">
        <h6>Notes &amp; Information:</h6>
         <p>This invoice contains a
   incomplete list of items destroyed by the Federation ship
   Enterprise on            Startdate     
   5401.6 in an unprovked attacked on a     peaceful &amp; 
    wholly scientific mission to Outpost 775.</p>
         <p>The Romulan people demand immediate compensation 
  for the loss of their Warbird, Shuttle, Cloaking Device, and
  to a lesser extent   thier troops.</p>
         <p>Failure to provide adequate compensation
  for the above losses will result in an immediate increase
  in Neutral Zone patrols &amp; a formal complaint will
  be filed in the form of increased aggresion on human 
  populated worlds within the neutral zone.</p>
     </div><!-- e: invoice-notes -->

  </section><!-- e: invoice financials -->


  <footer id="footer">
    <p>
         zamisoft</a>.
    </p>
   </footer>


  </div><!-- e: invoice -->


  </body>
  </html>
  ';

  // To send HTML mail, the Content-type header must be set
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

  // Additional headers
  $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
  $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
  $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
  $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

  // Mail it
  mail($to, $subject, $message, $headers);
  ?>

1 个答案:

答案 0 :(得分:0)

大多数电子邮件客户端不支持非内联css。您必须添加内联的所有css,并且不支持所有属性check here。出于安全原因,并不总是显示图像。