Can I save an email message as .eml file and open it using outlook?

Hi all,
I use the following codes to save the received email message as .eml files:
Session session = (Session)map.get("CURRENT_SESSION");
//InputStream is = msg.getInputStream();
MimeMessage mm = new MimeMessage(session, msg.getInputStream());
String filePath = AttachmentProcess.getInstance().getFilePath(attachmentId);
String fileName = AttachmentProcess.getInstance().getFileName(attachmentId);
mm.saveChanges();
mm.writeTo(new FileOutputStream(new File(filePath, fileName)));
But when I open it using window live mail, its content looks like this:
------_=_NextPart_001_01CA7E32.F3122E40
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
=20
New interaction from Thomas Lo on assignment "Assignment Enhancement":
=20
Interaction body goes here
=20
=20
When this email is sent to [email protected], it will be filed into
assignment "Assignment Enhancement" automatically.
Please don't modify this line. [ID: ASIGMT 51]
------_=_NextPart_001_01CA7E32.F3122E40
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/meetings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/xml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/directory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/parttopart" =
xmlns:st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40"
xmlns:ns2=3D"http://schemas.microsoft.com/sharepoint/soap/workflow/"
xmlns:ns3=3D"http://schemas.microsoft.com/office/2006/digsig-setup"
xmlns:ns4=3D"http://schemas.microsoft.com/office/2006/digsig"
xmlns:ns5=3D"http://schemas.openxmlformats.org/package/2006/digital-signa=
ture"
------_=_NextPart_001_01CA7E32.F3122E40--
Can anybody help me ?

This works now by coping all headers to the new MimeMessage from the coming message.
But one issue occurs when the email contains attachments.Because all attachment will be display on the email body.
What happens?

Similar Messages

  • How can I save an email as a text file before deleting from it my inbox?

    Some emails I want to save to my computer so that i can view them without opening up my email. I used to be able to do this by saving to a documents folder as a text file. (Outlook express). I do not find this capablity in Thunderbird. if it is there, I have not found it.

    '''File|Save As''' gives you several options. By default it will save as a .eml file, which will need an email client to view. You can usually save by drag-and-drop, but that creates an .eml file too.
    You can save as HTML by putting in an html file extension when doing File|Save As.
    This add-on:
    https://nic-nac-project.org/~kaosmos/mboximport-en.html
    gives you multiple options for saving one or more messages in various formats.

  • How can I save an email as a download file rather than a file in my email

    I wish to save entire emails in a windows folder rather than in an email folder. I have tried hitting "save as" but although I get a message telling me the download is complete I cannot open the documents. Also, I am getting weird icons after I try to download thses emails on my desktop. I am not that familiar with Mozilla but was running IE for the longest time. Any help would be appreciated.
    == This happened ==
    Every time Firefox opened

    '''File|Save As''' gives you several options. By default it will save as a .eml file, which will need an email client to view. You can usually save by drag-and-drop, but that creates an .eml file too.
    You can save as HTML by putting in an html file extension when doing File|Save As.
    This add-on:
    https://nic-nac-project.org/~kaosmos/mboximport-en.html
    gives you multiple options for saving one or more messages in various formats.

  • In Adobe Acrobat X, can you save a PDF to a temp file and forward the email back out?

    I'm running windows 7 Professional x64
    Adobe Acrobat X Professional
    Microsoft Office 2010 professional
    While  using Adobe Acrobat 9 with Office 2007, I have a user that was previously able to receive a PDF in Outlook, sign it, save it to the temp files, then forward the original email to a different user with my signature and changes saved within the PDF.  Now that I have upgraded to Acrobat X and Office 2010, that capability is no longer available, but I can complete the aforementioned process when using Microsoft Excel.
    Is there a way to do this with Adobe X and Office 2010, or was that capability removed with the upgrade to one of the 2 software packages? 
    The error that I get when signing a document is:
    document_name.pdf
    This file is set to read-only.
    Try again with a different file name

    These are the screens that I am presented with when trying to save or open a file in Adobe Acrobat Pro DC. I am logged in with my account and have mobile sharing activated on my iOS app.
    OS: Windows 7 64-bit.

  • How can I save an email as plain text when the save as is greyed out?

    How can I save an email message as a plain text document if the saved as command is greyed out? I am using OSX Mountain Lion. Macbook Pro thanks.

    OK, but is it happening to you with all messages or just some messages? If just some, can you characterize which ones? (Maybe messages with only one "alternative*" form, or with the "wrong" alternative for displayed, or messages containng images but no text?)
    * By "alternative" form, I mean in the sense of Mail > View > Message > Previous Alternative or Next Alternative or Plain Text Alternaive or Best Alternative.)
    Similarly, can you characterize the circumstances under which you cannot save an attachment?

  • How can I delete multiple email messages on my mobile device

    HOw can I delete multiple email messages from my ipad and iPhone

    Hello conniefromtulsa,
    The process for deleting multiple messages is detailed in the iPhone User Guide:
    Delete, move, or mark multiple messages. While viewing a list of messages, tap Edit. Select some messages, then choose an action. If you make a mistake, shake iPhone immediately to undo.
    iPhone User Guide - Work with multiple messages
    http://help.apple.com/iphone/7/
    Cheers,
    Allen

  • Can't save image, error message ???

    Hi, I'm trying to save a pdf image in photoshop, as I always do, hitting command S, or going to file-save. I keep getting an error message saying "could not save "x" file because the file is already in use or was left open". Well duh, of course it's in use, I'm working on it.
    Anybody know what's going on here? Am I missing something?
    Thanks!!
    Eric

    Thank you! I'll give it a try!
    Date: Sun, 16 Aug 2009 15:31:32 -0600
    From: [email protected]
    To: [email protected]
    Subject: can't save image, error message ???
    happens once in a while not sure why try a save as and over write the file now make changes and do a save and see if it works.
    If does not I would reset the preferences or trash the settings folder.
    >

  • How can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,-

    how can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,…"

    It sounds like if you open Preferences in Word there will be a place where you can specify where to store autorecover files. Right now it sounds like it's pointing to somewhere that doesn't exist.

  • How can I sav an emailed .mov file to my iPad?

    How can I sav an emailed .mov file to my iPad?

    Yes there is, if you hold down the attachment widget in the email once the video is downloaded, it will give you a series of options to save it to, including camera roll. 
    Hope this solves your question. 
    Cheers,
    Allen

  • HT1430 I can't delete 2 email messages. All others delete properly, however 2 will not delete no matter what I try. A pop up message comes up and says "cannot not delete"

    I can't delete 2 email messages that I received on the same day from one of my email accts. I have **** down the device and reset the device with no resolution to the problem. I can forward these two messages to our other acct and it will delete from there but returns to my personal email again, repeatedly. All other messages that I have deleted from my acct delete properly. I get a pop up indicating that " the message cannot be deleted". How do I fix this?

    Delete the mail account and setup again.

  • How can i save text/multimedia messages to my sim?

    I'm currently using 6085 phone.
    How can i save text/multimedia messages to my sim?
    Now I'm not able to see my incoming messages in SIM messages instead I'm getting this in my phone memory.
    Let me know the settings to be done to get all the new messages direcly to SIM.
    Thanks for the help :-)
    Regards,
    Senthil.

    You can't (if you have an S60 based phone; and even with others, only SMS can go to the SIM).

  • TS3899 Why can't I send email messages after 7.1?

    Why can't I send email messages after 7.1?

    Hi Honeylev,
    Welcome to the Support Communities!
    The article below will walk you through the troubleshooting steps for email on your iPhone:
    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    I hope this information helps ....
    Have a great day!
    - Judy

  • I can't sync my all email message between macbook pro and iPad 4

    Hi,
    I can't sync my all email message between macbook pro and iPad 4. This sync only complete account setting but not email message.
    Can anybody help me to fix the problem?

    You can't "fix" this problem because you can't sync email messages from the Mac mail app, you can only sync your email account settings. Messages will not sync using iTunes.

  • Please advise how I can stop all old email messages from my mac transferring to my new iPhone

    please advise how I can stop all old email messages from my mac transferring to my new iphone5 every time I open up email on it.

    Try Here... iPhone User Tip: Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141

  • How can I save an email as PDF?

    Hello everyone,
    I'm looking for some app that allows me to save an email as a PDF file.
    I know that before iOS 5 this was possibile, but I sound like to know how to do it now,both for iPhone and iPad.
    Thank you,
    Fabio

    Personally, I put pdf files on dropbox.  There's a free dropbox app for iOS devices, and a free setup for computers.  A dropbox account is free.

Maybe you are looking for

  • Why aren't all of my iPhone 6 contacts automatically on my Macbook Pro?

    My iPhone 6 is backed up to iCloud, however, even though my mid 2014 Macbook Pro (running Yosemite) is logged in to iCloud, only a small portion of my iPhone's contacts are present. Note- 1. All updates are installed on both devices. 2. I double-chec

  • Can't use credit card

    I can't use credit card to purchase any thing inside itune. Can you please do not block me. Please open it now urgently. Thank you.

  • Problem with iPhone application Build in xcode 4

    Hey Developers, I have an application that has been on the appstore for sometime.  I have recently updated it and want to distribute.  I have followed my usual approach by selecting 'release' in the edit scheme options and run a Build.  After the suc

  • AnalysisTool questions

    The AnalysisTool frontend for the Clang Static Analyzer looks to be very useful. Does anybody out there have experience with this tool? Here are some confusing (to me) error messages I get which I need help in understanding: This error: "the name of

  • Infinity just installed

    Infinity has just been installed, i'm averaged 30mb down speed and 10 mp up speed. http://www.speedtest.net/result/1637092976.png Also the internet keeps cutting out for about 30 seconds then coming back up every 5 minutes or so :/