【发布时间】:2014-01-11 08:22:32
【问题描述】:
下面的代码输出不正确的 html 并在其间插入一些垃圾字符。我认为解决方案将是基本转换。但我不知道是哪个基地。
<?php
$hostname = '{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail';
$username = '...@gmail.com';
$password = '*****';
$sent = imap_open($hostname, $username, $password) or die('Cannot connect to Gmail: ' . imap_last_error());
$emails = imap_search($sent, 'SUBJECT "Part"');
if ($emails)
{
foreach ($emails as $email_number)
{
$message = imap_body($sent, $email_number,1.2);
echo $message;
}
}
imap_close($sent);
?>
输出 HTML
<td colspan="3D"2""
st="yle=3D"
border-color:rgb(204,204,20=" 4);
border-width:0px="" 0px="" 1px="" 1px;
font-family:ari="al;
color:rgb(255,255,255);
background-color:rgb(123,186,0=" );
text-align:center;
width:100px"="">
【问题讨论】: