当HTML字符串发送到邮件帐户时,邮件正文内容未按原样接收

时间:2016-12-04 15:58:36

标签: php imap html-email

我每个用户有一个域电子邮件帐户(后端Web应用程序) - 业务要求是通过php管理邮件帐户。

我开始在PHP中使用IMAP,我能够读取/发送/更新电子邮件内容,我在接收带有html文件的电子邮件模板时出现问题,并且html字符串(我认为)已被编码 - 原因是: -

电子邮件模板字符串就像 - (只是第一个表格行)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="" content="" />
<title><?php echo $magazine->name; ?></title>
</head>

<body bgcolor="#ececec">

  <table data-bgcolor="background" data-module="module2" style="background-color: rgb(33, 33, 33); opacity: 1; position: relative; z-index: 0;" align="center" bgcolor="#212121" border="0" cellpadding="0" cellspacing="0" width="100%" class="">
   <tbody><tr>
    <td>
     <table width="800" bgcolor="#ededed" align="center" cellpadding="0" cellspacing="0" border="0" class="table600" style="mso-table-lspace:0pt;mso-table-rspace:0pt;">
          <tbody><tr>
            <td width="800" class="tdLogo" bgcolor="#ededed" align="left"> 
              <table width="230" align="left" cellpadding="0" cellspacing="0" border="0" bgcolor="#ededed" class="table600Logo" style="mso-table-lspace:0pt;mso-table-rspace:0pt;">
                <tbody><tr>
                  <td>
                    <table cellpadding="0" cellspacing="0" bgcolor="#ededed" border="0" class="centerize" style="mso-table-lspace:0pt;mso-table-rspace:0pt;">
                      <tbody>
                        <tr>
                        <td valign="middle" align="center" height="100" style="line-height:1px; padding-left:50px;"><a href="#" target="_blank"><img src="<?php echo $magazine->images; ?>" style="display:block;" alt="Logo Image" border="0" align="top" hspace="0" vspace="0" width="263" height="36"></a></td>
                        <td width="30" class="esFrMb"></td>
                      </tr>
                    </tbody>
                  </table>
                  </td>
                </tr>
              </tbody>
            </table>

虽然我使用imap_fetchbody($imap_resource,13,1.2,FT_UID);并在电子邮件中获取html字符串 - 像3D这样的内容正在多次为文本添加前缀 -

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" />
<meta name=3D"" content=3D"" />
<title>Ledernytt</title>
</head>

<body bgcolor=3D"#ececec">

  <table data-bgcolor=3D"background" data-module=3D"module2" style=3D"backg=
round-color: rgb(33, 33, 33); opacity: 1; position: relative; z-index: 0;" =
align=3D"center" bgcolor=3D"#212121" border=3D"0" cellpadding=3D"0" cellspa=
cing=3D"0" width=3D"100%" class=3D"">
   <tbody><tr>
    <td>
     <table width=3D"800" bgcolor=3D"#ededed" align=3D"center" cellpadding=
=3D"0" cellspacing=3D"0" border=3D"0" class=3D"table600" style=3D"mso-table=
-lspace:0pt;mso-table-rspace:0pt;">
          <tbody><tr>
            <td width=3D"800" class=3D"tdLogo" bgcolor=3D"#ededed" align=3D=
"left"> 
              <table width=3D"230" align=3D"left" cellpadding=3D"0" cellspa=
cing=3D"0" border=3D"0" bgcolor=3D"#ededed" class=3D"table600Logo" style=3D=
"mso-table-lspace:0pt;mso-table-rspace:0pt;">
                <tbody><tr>
                  <td>
                    <table cellpadding=3D"0" cellspacing=3D"0" bgcolor=3D"#=
ededed" border=3D"0" class=3D"centerize" style=3D"mso-table-lspace:0pt;mso-=
table-rspace:0pt;">
                      <tbody><tr>
                        <td valign=3D"middle" align=3D"center" height=3D"10=
0" style=3D"line-height:1px; padding-left:50px;"><a href=3D"#" target=3D"_b=
lank"><img src=3D"http://95.211.75.201/~ledernytt/resources/uploads/magazin=
es/1455781037.png" style=3D"display:block;" alt=3D"Logo Image" border=3D"0"=
 align=3D"top" hspace=3D"0" vspace=3D"0" width=3D"263" height=3D"36"></a></=
td>
                        <td width=3D"30" class=3D"esFrMb"></td>
                      </tr>
                    </tbody>
</table>

可能是什么问题...

0 个答案:

没有答案