|
function getBody($mid,&$path,$imageList) // Get Message Body
{
if(!$this->marubox)
return false;
$body = $this->get_part($this->marubox,"TEXT/HTML");
if ($body == "")
$body = $this->get_part($this->marubox,"TEXT/PLAIN");
if ($body == "") {
return "";
}
//处理图片
$body=$this->embed_images($body,$path,$imageList);
return $body;
}
function embed_images(&$body,$imageList)
{
// get all img tags
preg_match_all('/<img.*?>/',$body,$matches);
if (!isset($matches[0])) return;
foreach ($matches[0] as $img)
{
// replace image web path with local path
preg_match('/src="(.*?)"/',$img,$m);
if (!isset($m[1])) continue;
$arr = parse_url($m[1]);
if (!isset($arr['scheme']) || !isset($arr['path']))continue;
// if (!isset($arr['host']) || !isset($arr['path']))continue;
if ($arr['scheme']!="http")
{
$filename=explode("@",$arr['path']);
$body = str_replace($img,' ',$body);
}
}
return $body;
}
function deleteMails($mid) // Delete That Mail
{
if(!$this->marubox)
return false;
imap_delete($this->marubox,$mid);
}
function close_mailbox() //Close Mail Box
{
if(!$this->marubox)
return false;
imap_close($this->marubox,CL_EXPUNGE);
} (编辑:网站开发网_安阳站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|