Solved

Embedd Image in Html file

Posted on 2009-05-20
12
194 Views
Last Modified: 2013-12-25
Hi,

I want to embedd Image in HTML file.

How can I do that.

I need to send email with embeded image

So, I need to provide 3rd party application a html with html page

Please guide me to do so

Many Thanks
0
Comment
Question by:tia_kamakshi
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 9

Expert Comment

by:hmare
Comment Utility
What are you using for an email client?
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
Comment Utility
What do you want to do exactly?

Do you want to design html newsletter like?
0
 

Author Comment

by:tia_kamakshi
Comment Utility
It is a third party application, which reads xml and read html file location from xml file and to address etc and send mail

So I just wanted to pass the html file path in xml file to that application in some folder location

Therefore I need html file where images is embeded

Many Thanks for your response
0
 
LVL 17

Expert Comment

by:OmniUnlimited
Comment Utility
A simple coding in your HTML file should do it.
<img src="http://yourwebsite.com/images/email_image.gif" alt="email image">

Open in new window

0
 

Author Comment

by:tia_kamakshi
Comment Utility
Thanks for your response. But I do not have any site to upload my images

How should we send html mails with images now

Thanks again
0
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 500 total points
Comment Utility
You need a source from which you get your images.  Where are the images stored that you want to send via email?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:tia_kamakshi
Comment Utility
No, I know it is possible

here the message body should start with

The message body would start with something like :
Content-Type: multipart/related;
 boundary="MIME_Multipart_Related_Boundary"

--MIME_Multipart_Related_Boundary
Content-type: text/html; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable


html>

.. etc ..

then somewhere you would reference your images :

<img src="cid:My_image" />

...

<img src="cid:My_second_image" />

.. etc ..

then the HTML part would end, and the image parts
would start, with the images encoded in base64,
followed by the marker for the end of
the multipart/related section :

</html>

--MIME_Multipart_Related_Boundary
Content-Type: image/jpeg;
 name="Image_file_name.jpg"
Content-Transfer-Encoding: base64
Content-ID: <My_image>
Content-Disposition: inline;
 filename="Image_file_name.jpg"

/9j/4AAQSkZJRgABAQEAYwBjAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAXQ3JlYXRl
ZCB3aXRoIFRoZSBHSU1Q/9sAQwABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB/9sAQwEBAQEBAQEBAQEBAQEBAQEBAQEB
Lb3xUqFRRk4xS7EWpbbkiy/zIKOj4fHFWKsYUjs90jJewETFzkvVkaZ4+bSPVW6j2Fjwp5Cq
ADx2LEqPgE9vkHnWUsxA7BNvzJtW0Pa4xBNWe6lDajMUZ1islW7spoier+JUjjHNNNNaNSem
mmmjRppppo0aaaaaNGmmmmjRr//Z
--MIME_Multipart_Related_Boundary
Content-Type: image/gif;
 name="Second_image_file_name.gif"
Content-Transfer-Encoding: base64
Content-ID: <My_second_image>
Content-Disposition: inline;
 filename="Second_image_file_name.gif"

/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAXQ3JlYXRl
ZCB3aXRoIFRoZSBHSU1Q/9sAQwABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB/9sAQwEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB/8AAEQgAMgGy
B70pSswaPcqq2hakrKGVrfBVgCpBkTIIOQQfaDUD2FDDFql2YoYoydPcEpGiEj0i2OCVAJGf
ZSlWtSXH4BbFKUqAKqrf0MMuo2RlhikIssAyRo5A68pwCwJAz7KUq4Xvh7QPK0jjFrbAIgAt
4QAFUAARqAAAMAAdgB5UpStQf//Z
--MIME_Multipart_Related_Boundary--

Of course this does not make a full e-mail, you need to add the proper
rfc-822 headers



But I am not able to get it done, so I posted the question.

Please comment
0
 
LVL 17

Assisted Solution

by:OmniUnlimited
OmniUnlimited earned 500 total points
Comment Utility
Oh!  Now I know what you are meaning!

Does this look like what you need?
http://aspalliance.com/1354_Sending_HTML_Mail_with_Embedded_Image_in_NET.all#Page8
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
Comment Utility
0
 
LVL 3

Expert Comment

by:crittle1
Comment Utility
you can host your images on something like photobucket... AND it will automatically give you the link code to embedd the image too. Maybe that can get you started.
0
 

Author Closing Comment

by:tia_kamakshi
Comment Utility
Thanks
0
 
LVL 17

Expert Comment

by:OmniUnlimited
Comment Utility
Glad the answer worked for you! ;)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now