Regards to JAVA MAIL HEADER
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   alvin_oh
Posted On:   Monday, November 11, 2002 10:02 PM

I need to know how do you remove the additional line that appear after the header in the attachment file after you have written to the file. Enclose is the code: Part part = mp.getBodyPart(j); String disposition = part.getDisposition(); String rawData = part.getFileName(); if (part.getFileName() != null) { if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))) { tempFile = new File(home + part.getFileName()); fos = new FileOutputStream(tempFile); part.removeHeader("Content-Type"); part.removeHeader("Content-Transfer-Encoding"); part.removeHeader("   More>>

I need to know how do you remove the additional line that appear after the header in the attachment file after you have written to the file.

Enclose is the code:

Part part = mp.getBodyPart(j);

String disposition = part.getDisposition();
String rawData = part.getFileName();

if (part.getFileName() != null)
{

if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE))))
{

tempFile = new File(home + part.getFileName());
fos = new FileOutputStream(tempFile);

part.removeHeader("Content-Type");
part.removeHeader("Content-Transfer-Encoding");
part.removeHeader("Content-Disposition");

part.writeTo(fos);

tempMessage.setFlag(Flags.Flag.DELETED,true);

}

logAction(siteid, rawData, "Successfully Download Batch Email", email);
}

As shown that i have use the removeHeader function but my file keep appear like this:

<---- an additional line after the header.
testing 123
testing 456
testing 6778

How do you get rid of this line. Please help. Thank you.

   <<Less

Re: Regards to JAVA MAIL HEADER

Posted By:   Jeff_Gay  
Posted On:   Tuesday, November 26, 2002 06:13 AM

I don't have time to explain it, but if you look at the ICEMail source code (www.icemail.org) then you'll find what you're looking for...
About | Sitemap | Contact