If phpmailer sends an image, the system prompts that the image is successfully sent, but the image is not displayed in the email.

Source: Internet
Author: User
Tags image line
When phpmailer sends an image, it prompts that the image is successfully sent, but the image in the email is not shown as the question. The body format is HTML. I made an editing page and the image can be displayed on the editing page, however, the image is on an intranet server. is it related to the path?


Reply to discussion (solution)

You can see the path.

Is the image connected?
Use intranet (or local) images as attachments

You can see the path.


The path is the path of the image on the intranet server. it can be displayed normally on my own editing page.

The email cannot be displayed after it is accepted.


Can I use phpmailer to send images as long as the image path is used? What is the principle?

Is the image connected?
Use intranet (or local) images as attachments



The image is indeed a link, because it is found from the database. I want to send an article by email. there will be images in the article, which must be displayed in the content. attachments cannot be sent.

What is the path in the email?

What is the path in the email?





The path in the email is the path of the image taken from the database. The image is placed on an intranet server and can be viewed in an intranet environment.

Now I want to know how phpmailer works to send emails. I should not be able to send images with just one link.

/Js/ueditor1_3_5-gbk-php/php/upload/84301406165833.jpg

Is this path incorrect? is the domain name missing? Does your image reference the image line on the Internet over the intranet?

/Js/ueditor1_3_5-gbk-php/php/upload/84301406165833.jpg

Is this path incorrect? is the domain name missing? Does your image reference the image line on the Internet over the intranet?



So I am also entangled in this issue. if phpmailer only sends tags and links to images, the images in the intranet or local network will not be displayed, so what is the purpose of sending an image?

Use the AddEmbeddedImage method to send a local image, for example

$id = 1;$mail->AddEmbeddedImage('03.gif', $id, 'attachment', 'base64', 'image/gif');$body .= '';
In the body of the email
Such code 

It's too troublesome to do it one by one.
Therefore, you should write a method to match the local image in $ body and process it one by one.

How can I process images in the intranet? it cannot be tested without the intranet.
You can refer to this http://www.oschina.net/code/snippet_54100_2855

Is the landlord still there? I have the same question. could you please advise?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.