0

I am using PHP to send mail of a webpage content. I have a table in the page. My table does not show row and column borders in email sent using PHP mail. It does not read the CSS in email. This is my code:

<div id="table_email" style="width:800px;margin-left:50px; text-align: left;">
    <table class="table1">
        <tr>
            <th>Description</th>
            <th colspan="2">Amount</th>
        </tr>
        <tr>
            <td>(A)Package Cost</td>
            <td>';$formatedMessag .= $inv[0].'</td>
        </tr>
        <tr>
            <td>(B) Insurance </td>
            <td>';$formatedMessag .= $inv[1].'</td>
        </tr>
        <tr>
            <td>(C)Flight / Train</td>
            <td>';$formatedMessag .= $inv[2].'</td>
        </tr>
        <tr>
            <td>Add : &emsp;Service Tax 3% on Rs.(a+b)</td>
            <td>';$formatedMessag .=$inv[5].'</td>
        </tr>
        <tr>
            <td>Add : &emsp;Educational Cess 2% On 3% </td>
            <td>';$formatedMessag .= $inv[6].'</td>
        </tr>
        <tr>
            <td>Add : &emsp;Secondary& Higher Education Cess 1% on 3% </td>
            <td>';$formatedMessag .= $inv[7].'</td>
        </tr>
        <tr style=" font-weight: bold;font-size: 12px;background-color:seashell;">
            <td>Total Payable Amount</td>
            <td>';$formatedMessag .='INR ' . $inv[9].'</td>
        </tr>
        ';$formatedMessag .='
    </table>
</div>

This is my CSS:

.table1{
    width: 990px;
    margin-left: 5px;
    border: 1px solid #CDCDCD;
}
.table1 th{
    background: none repeat scroll 0 0 #EEEEEE;
    padding: 10px;
    font-size: 11px;
    color: #777777;
    border: 1px solid #CDCDCD;
}
.table1 tr{
    padding: 10px;
    font-size: 11px;
    height: 30px;
    border: 1px solid #CDCDCD;
}
.table1 tr td:first-child{
    font-weight: bold;
    text-align: left;
    border: 1px solid #CDCDCD;
}
.table1 td{
    padding-left: 3px;
    border: 1px solid #CDCDCD;
    color: #333333;
}
4

1 回答 1

0

这是因为当您发送邮件时,它无法访问样式类,而不是<table class="table1">使用内联 css,例如:

<table style='width: 990px; etc;'>.
于 2012-11-09T10:33:56.780 回答