Home > Backend Development > PHP Tutorial > phpmail发送嵌入式图片的问题

phpmail发送嵌入式图片的问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:40:23
Original
1481 people have browsed it

我用phpmail发送嵌入式图片,用 

$mail->AddEmbeddedImage($arr['path'], $id, 'img', 'base64', 'image/jpeg');$message=str_replace($img, '<img alt="" src="cid:'.$id.'"   style="max-width:90%" />', $message);
Copy after login

但邮件正文并没有改变,接收不到图片。
不知道是什么原因导致。


回复讨论(解决方案)

邮件正文 一般如果包含图片 用html形式就行,在img标签设置src就可以了。PHPmailer是支持html格式的。或者发附件可以的。
另外在网上看到这个方法的使用方法如下:

AddEmbeddedImage(PICTURE_PATH. "index_01.jpg ", "img_01 ", "index_01.jpg ");
在html中引用

这里也用到html格式

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