我使用PHPhmailer并附加了一个图像,它只显示图像,而不是图像本身,这里是我的代码
你能帮忙吗
你能帮忙吗
$mail->AddEmbeddedImage('2.jpg','2img','2.jpg'); $mail->Subject = "Order Form: Contact form submitted"; $mail->Body = $body . 'img src="../../photo/2img" ;
每
PHPMailer Manual,你应该使用AddEmbeddedImage方法
原文链接:https://www.f2er.com/php/132952.html$mail->AddEmbeddedImage(filename,cid,name); By using this function with this example's value above,results in this code: $mail->AddEmbeddedImage('my-photo.jpg','my-photo','my-photo.jpg ');
喜欢这个:
$mail->AddEmbeddedImage("rocks.png","my-attach","rocks.png"); $mail->Body = 'Embedded Image: <img alt="PHPMailer" src="cid:my-attach"> Here is an image!';
所以cid:my-attach将被电子邮件正文内的图像的内联源代替