大家好我想通过电子邮件发送电子邮件功能在php但是在发送电子邮件和回复邮件正文之前它显示我需要的东西但是这个机构发送的邮件是一些css无法正常工作。我已经附加了两个图像(screenshorts),一个是在发送电子邮件之前,另一个是在我发送电子邮件之后,你会理解正确的。
$body.= '<table border=1><tr><th>Branch</th>';
for($i=0;$i<count($sections);$i++)
{
if($sections[$i]!="Task Admin")
$body.="<th>".$sections[$i]."</th>";
}
$body.="</tr>";
foreach($mainarrayparent as $keys => $value ) {
$body.="<tr>";
foreach($value as $keys1 => $getbranch ) {
$getb = mysql_query("SELECT * from branch where id = '".$keys1."'");
$getbrow = mysql_fetch_assoc($getb);
$body.="<td>".$keys1." - ".$getbrow['name']."</td>";
foreach($getbranch as $keys3 => $getinner ) {
if($getinner==0){
$body.="<td style='background-color:#C6EFCE;'>".$getinner."</td>";
}else if($getinner!=0){
$body.="<td style='background-color:#FFC7CE;'>".$getinner."</td>";
}
else{
echo $keys3;
}
}
}
$body.="</tr>";
}
$body.="</table>";
//#C6EFCE
echo $body;
// die;
//get overdue
$subject = "Acquisition Updates";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <intranet@daylewis.net>' . "\r\n";
$result = mail('jignesh.prajapati@daylewisplc.co.uk',$subject,$body,$headers);
答案 0 :(得分:0)
PHP_EOL
可能有所帮助。
foreach ($getbranch as $keys3 => $getinner) {
if ($getinner == 0) {
$body .= "<td style='background-color:#C6EFCE;'>" . $getinner . "</td>" . PHP_EOL;
} else if ($getinner != 0) {
$body .= "<td style='background-color:#FFC7CE;'>" . $getinner . "</td>" . PHP_EOL;
} else {
echo $keys3;
}
}