请教用phpmailer发html格式邮件的外部图片问题

WBOY
Release: 2016-06-23 14:01:06
Original
1300 people have browsed it

目前是用PhPmailer来发送邮件,自己定义了一个邮件模板,html格式的,中间会有一些外部文件的图片,

我不要那种打开邮件要手动点击一下下载图片,然后才能看到邮件图片的效果,

我要的效果是打开邮件,图片就显示出来。

我试了用这个方法去做,但是好像也不行, 

ob_start(); 
readfile($url); 
$img = ob_get_contents(); 
ob_end_clean(); 
$image_data = "data:image/png;base64,".base64_encode($img);

然后再把这个$image_data放到放到img src 里面, 但是还是没用,显示出来图片是带大叉的

高人帮我看看我哪里不对了


回复讨论(解决方案)

我已经解决了,如果你也需要的话我把代码片段发给你, 你留个邮箱

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!