i have a image in my local server ,i need to send an activation mail to the user.in that mail content i am trying to use one image using IMG SRC tag.but the image is not displaying in the mail sent to user.kindly give me suggestions
Asked
Active
Viewed 279 times
0
-
1The image needs to be online. Then you set the online image link in the mail which the user's web browser can access, load and display as well. – Ahs N Aug 03 '15 at 09:21
-
2You can display image in base64 format in image tag. – Nikunj Chotaliya Aug 03 '15 at 09:22
-
v can display the image in local server by giving the complete path in the mail content ? – John Sk Aug 03 '15 at 09:24
-
upload ur image in any of the image hosting sites like http://postimage.org/ and use that image link if you do not have domain and server of your own – madhu Aug 03 '15 at 09:26
-
Either you should keep the image online and use the URL or should embed image in the email itself. This link may help you. How to embed images in html email – Tismon Varghese Aug 03 '15 at 09:28
1 Answers
0
Here is a Tutorial for Data-URIs. There are many information, just read through it!
TL;DR:
Encode an image here After encoding you will get a huge link in this format:
<img src="data:image/[FORMAT];base64,[BASE64-CODE]" />
Example:
<img src="data:image/jpg;base64,9j4AAQSkZJR/gABA/QEASABIAA … "/>
I still would suggest to read through that tutorial. I would want to know, what I am doing on my (local) server …
[EDIT]:
Best practice - as others already said it - just try to get the picture online. There are many advantages with Base-64-Encoded data, but there are many disadvantages, too! Just wanted to make sure, that this is not the best solution!
For further information on this topic … google it!

Haudegen
- 498
- 1
- 4
- 17