peeker rewrite_html_transform_img_tags不显示完整路径

时间:2015-04-29 05:34:35

标签: html image

有没有人有Peeker图书馆的电子邮件提取经验? https://github.com/sophistry/peeker

我正在使用此库来获取电子邮件并在HTML页面中显示

一切正常,但我无法在HTML中呈现内嵌图像, 使用下面的代码,我的内联图像存储在本地文件夹中,但在html链接src没有完成,

$this->peeker->set_attachment_dir('./uploads/attachments/');
                    $email->save_all_attachments('./uploads/attachments/'); 
                    $email->rewrite_html_transform_img_tags($this->peeker->get_attachment_dir());
                    $newbody = $email->HTML_rewritten;

当我打开HTML并检查图片元素时,我的源路径似乎没有完成,

见下文,

<img height="177" width="284" apple-width="yes" apple-height="yes" apple-inline="yes" id="B13231B0-E5D8-49C8-9D89-52A3F8F039F0" src="./uploads/attachments/916207711e0253ebff5d3d24702718fc/images.jpeg" class="">

如何显示src =&#34; ...

的完整路径

我可以在路径中看到images.jpeg ... / uploads / attachments / images.jpeg,

对此有何建议?

1 个答案:

答案 0 :(得分:0)

我解决了自己! 给定基本网址,

$email->rewrite_html_transform_img_tags($base_url = 'http://localhost/testcenter/uploads/attachments');