糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > php邮件发送可以发送图片吗 phpmailer发送图片

php邮件发送可以发送图片吗 phpmailer发送图片

时间:2019-03-20 17:33:45

相关推荐

php邮件发送可以发送图片吗 phpmailer发送图片

两种方法:

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发送图片》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。