有没有人有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,
对此有何建议?
答案 0 :(得分:0)
我解决了自己! 给定基本网址,
$email->rewrite_html_transform_img_tags($base_url = 'http://localhost/testcenter/uploads/attachments');