Solved

How to show image in a HTML file (to send as EMail)

Posted on 2012-03-20
9
431 Views
Last Modified: 2012-03-21
I've a HTML file in a folder. The HTML file contains some placeholder. I'll replace the placeholder with appropriate content. Then that will be sent as E-mail to user.

I've image in the HTML file. Src="MyFile.jpg".

NOTE: The html file and Image are in same folder in my project.

While sending Email the image is missing. How to resolve this issue?

Please do suggest
0
Comment
Question by:Easwaran Paramasivam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37745893
If you use an absolute URL (http://www.mysite.com/myimage.jpg) instead of a relative link (myimage.jpg), they will be able to see the image.  They will probably have to Ok the download of the image but that's normal these days.
0
 
LVL 19

Expert Comment

by:Rikin Shah
ID: 37745894
Hi EaswaranP,

There are few options-
- You have to attach the image with the mail and give the relative path
- You can host the image somewhere on internet and give the path to it. (not advisable)
- You can embed the image with the mail (most recommended) Convert it to base64

Go through this-
http://danielmclaren.com/node/90

Regards,
Rikin.
0
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 37745901
I would use this free component http://www.codeproject.com/Articles/19546/MailMergeLib-A-NET-Mail-Client-Library

Not only does it handle the placeholders for you, it automatically embeds the images, and it sends better emails than the standard .net ones.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 37745942
Hi Rikin_shah.

  I like your third point. But how to achieve this in .NET in such a way that it should be opened correctly in any browser including outlook.

  Please do suggest.
0
 
LVL 19

Expert Comment

by:Rikin Shah
ID: 37745969
Hi EaswaranP,

If there are very few/static images to be embedded in your mail, you can go for the online base64 converter-
http://www.motobit.com/util/base64-decoder-encoder.asp

In case you need to embed images dynamically, then use this methods-
http://www.dailycoding.com/Posts/convert_image_to_base64_string_and_base64_string_to_image.aspx

Regards,
Rikin.
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 37745989
You have to attach the image with the mail and give the relative path

Please do provide sample for this option. If adding as attachment I am not sure how this could be showns as Embeded image.

I am using static image only.
0
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 37746079
0
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 37746169
Or do it the easy way using the component I recommended... you'd have it done and working by now if you had :)
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 37746578
This saved my day. Thanks!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question