How can i attach an image using Phpmailer?

前端 未结 2 1598
有刺的猬
有刺的猬 2020-12-15 23:29

I am using phphmailer and have attached an image, it shows only the image like an icon rather than image itself here is my code could you help.

$mail->Ad         


        
2条回答
  •  抹茶落季
    2020-12-15 23:52

    Using the AddEmbeddedImage() function works well in showing the embedded image in the web based emails. However, Yahoo always adds it as an attachment too. To overcome this problem, you can safely disregard the AddEmbeddedImage() and link to the full path of the image on your server and PHPMailer has the capacity of converting it to CID and It will correctly show as embedded image and Yahoo won't add it as an attachment anymore.

    In the html body of the message, add it like usual:

    THIS IS THE IMAGE" /></code></p>
    </p>
             <div class="appendcontent">
                                                        </div>
            </div>
            <div class="jieda-reply">
              <span class="jieda-zan button_agree" type="zan" data-id= 0 讨论(0)

提交回复
热议问题