两种方法:
1、把网络上的地址做为参数发出去。用户浏览到的图片是网上下载到的图片。
2、把图片随着邮件做为内容的一部分出去,这样的话,数据流量比较大,发送速度比较慢。通过AddEmbeddedImage函数实现。
AddEmbeddedImage($ path,
$ cid,
$ name = "",
$ encoding = "base64",
$ type = "application/octet-stream"
)
Adds an embedded attachment.
This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
Parameters:
string $path Path to the attachment.
string $cid Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
string $name Overrides the attachment name.
string $encoding File encoding (see $Encoding).
string $type File extension (MIME) type.
Returns:
bool
Definition at line 1274 of file class.phpmailer.php.
References $name, $path, $type, PHPMailer.Lang(), and PHPMailer.SetError().
如果觉得《php邮件发送可以发送图片吗 phpmailer发送图片》对你有帮助,请点赞、收藏,并留下你的观点哦!