How to Email a multipart object as an attachment
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   asif_koroth
Posted On:   Monday, August 25, 2003 11:59 PM

I basically want to send a multipart object as an attachment using java mail.My multipart object contains a remote html file contents and related gifs. I want to send the whole object as attachement so that the user can save it locally and view the html and embedded gifs.this is what i did MimeMultipart multipart = new MimeMultipart("related"); messageBody.setContent(totContent,"text/html");//totContent is the html file contents. multipart.addBodyPart(messageBody); //loop to embed the gifs messageBody.setDataHandler(new DataHandler(new URL(imagepath))); messageBody.setHeader("Content-ID", imgName); multipart.addBodyPart(messageBody); //loop ends i wa   More>>

I basically want to send a multipart object as an attachment using java mail.My multipart object contains a remote html file contents and related gifs. I want to send the whole object as attachement so that the user can save it locally and view the html and embedded gifs.this is what i did


MimeMultipart multipart = new MimeMultipart("related");
messageBody.setContent(totContent,"text/html");//totContent is the html file contents.
multipart.addBodyPart(messageBody);
//loop to embed the gifs
messageBody.setDataHandler(new DataHandler(new URL(imagepath)));
messageBody.setHeader("Content-ID", imgName);
multipart.addBodyPart(messageBody);
//loop ends

i want this multipart to be send as an attachment. Please enlighten me.......this is a bit urgent........

   <<Less
About | Sitemap | Contact