在PHP中使用mail()在电子邮件中显示图像 [英] Display images in email using mail() in PHP

查看:109
本文介绍了在PHP中使用mail()在电子邮件中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在PHP中使用 mail()函数在电子邮件中显示图像?

How do I display images in an email using the mail() function in PHP?

c $ c

Does putting <img src="image path" /> work?

推荐答案

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

然后发送与

mail($to, $subject, $message, $headers);

所以你将标题作为一个字符串传递到第< 。

so you pass the headers as a string to the 4th parameter of mail().

您应该在 charset 中设置相关字符编码,并提供一个文本版本,如果这将是最终用户。

You should set the relevant character encoding in charset, and also provide a text version if this is going to end users.

这篇关于在PHP中使用mail()在电子邮件中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆