Hi,
Upto my knowledge we can't embed images in HTML files as like word, in IE you
can find an option to save the file with images, in this case they use to store
the images in temp internet files directory. So, we have to use either IMG -
HREF or IMG - SRC, in both the cases images will lies on the server side.  If
there is any other way to display images "pls update me too"

for Java mail  - take Javamail 1.2, and try the following method hope it may
help you..
Before composing your  message add following mime types as default. just a
standalone code which will internally set the file types for content as well as
the attachment(s)..
    MimetypesFileTypeMap mimeFileType = new MimetypesFileTypeMap();
    mimeFileType.addMimeTypes("text/plain eml EML log LOG txt TXT");
    mimeFileType.addMimeTypes("image/gif gif");
    FileTypeMap.setDefaultFileTypeMap(mimeFileType);

then create a MimeMultipart object to add the content and the attachment.
    Multipart bodyMsg = new MimeMultipart();

now add your message (content)
       MimeBodyPart msgText = new MimeBodyPart();
       msgText.setDisposition(Part.INLINE);
       msgText.setContent(message.toString(), "text/plain");
       bodyMsg.addBodyPart(msgText);

now add the attachemnt as follows
       MimeBodyPart attachment = new MimeBodyPart();
       attachment.setDisposition(Part.ATTACHMENT);
       attachment.setDescription("Solution file attached ");
       bodyMsg.addBodyPart(attachment);

Message composeNewMsg = new Message();
set all from, to, etc...
composeNewMsg.setContent(bodyMsg);

refer the following site for more info
http://www.iac.net/~crawford/programming/javamail.html
http://www.javacommerce.com/articles/sendingmail.htm

Regards
G S Sundaram


Raghavendran_c wrote:

> Hi,
>         This may not be linked with Servlets but, but please reply if anyone
> knows how to solve this problem of mine.
>         I am trying to send a html file with an embedded image in it. Is it
> possible to do so
> using the present release of JavaMail API. At present I am only able to send
> normal htmls
> with IMg tags which have HREF attribute pointing to the file in my PC... I
> dont want this to happen as
> our network is pretty large (spans across nearly 7 Cities across India) and
> downloading an image
> at the client side would be real slow. Please do recommend a way by which I
> can send the image emmbeddedalong with
> the html page itself.
>
> Thanks and regards,
> Raga
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to