How to extract a .eml (e-mail file) "attachment" from an e-mail

Hi,
I have a slight problem with e-mail attachments. It's quite an explanation, so stick with me please.
I have to extend, debug and adapt an e-mail archive for my company.
I already worked on this project for 2 months, to make an extra batch and change some functionality of the existing e-mail archive.
I've been outsourced for a montsh, and now back on the e-mail archive.
There were some problems with e-mail attachments. (.gif, .doc, ...)
Some of them weren't shown in the web application.
The code that already has been written has a custom Email object. This e-mail object contains custom EmailBodyPart objects. Every EmailBodyPart has a disposition (Part.INLINE or Part.ATTACHMENT).
In every JavaMail Message object, every BodyPart is read, the disposition is extracted, and an EmailBodyPart is created with the disposition and some other data. Then, this EmailBodyPart is added to the Email object.
But sometimes, an attachment (.gif, .doc, ...) doesn't have the correct disposition in a Message, and isn't added as attachment, but as INLINE.
This way, in the web application, there aren't any attachments visible for the e-mail, but when you send the mail back to your inbox through the web interface, you can see the attachments again.
I had to solve this, and make the attachments visible in the web interface, and i did. I just checked if a filename was present, and if it wasn't an image (images still can be inline), then the disposition of the EmailBodyPart is set to Part.ATTACHMENT. It is visible now.
But now on to the problem...Sometimes, an e-mail (.eml file) is added to an other e-mail as an attachment. But, this e-mail isn't included as disposition attachment, but just as an other message within the message. It doesn't even have a file name. It seems like this is just a forward or something.
This e-mail should be visible as an attachment of the surrounding e-mail within the web interface. Does anyone have an idea how i can accomplish this and extract this body part as an attachment? Are there any headers i can check? (I printed the headers of the body part and there were only three, content-type, encoding en such ... but nothing like disposition. I tried to set the disposition to attachment to make it visible as an attachment, but that didn't work.
Thanks already in advance.

Hi there,
Thanks for your reply.
Well, it was kind of a mistake in the webapplication itself. The object passed to the related method was an instance of MimeMessage (the previous programmer only checked MimeMultiParts), and those weren't added to the vector of attachments. Now they are.
But now i still have problems. I have to give those attachments a file name. I tried extracting the subject from the message, but in the related method the message is casted to a multipart (is needed for further processing), and i can't fetch the sub-message's subject (if i get the part, i can't get the subject header anymore).
If i don't give the file a .eml extension, it opens a MHTML file or something, and it is unreadable by windows. If i get an InputStream of the part's content, and return that, and give the attachment a .eml extension, i get the outlook window , but all the text is pure HTML code. Not like it should be, and the mail in Outlook doesn't have any headers (no from, no to, no subject, ...)
Any idea here ? I could suply you with some code, but i don't understand all the steps myself, i got on this project which was build by someone else. It's quite a lot of code.
Thanks in advance.

Similar Messages

  • How to email a .zip file attachment from PC

    Hi,
    Please, let me know how to email a .zip file attachment from Presentation Server.
    Thanks,
    Madhuri.

    Hi,
    try fm SO_DOCUMENT_SEND_API1
    it's well documented (look with SE37)
    and look here:
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    regards Andreas

  • How to extract all keys (PK, FK) and constraints from the schema?

    hi,
    How to extract all keys (PK, FK) and constraints from the schema?Thanks!

    I have no idea about any tool which only extract the DDL of constraints.
    In oracle 9i or above you can use DBMS_METADATA to extract DDL of a table which also shows contraints defination.
    You can take the tables export without data and use databee tool to extract the DDL.
    www.databee.com

  • How to extract the contents of ZIP file stored in oracle database column ?

    The file is in ZIP format and it is stored in BLOB databse column . The contents of file is in binary format .
    How to extract those contents from file and thus creating the same ZIP file as output in ODI ?
    Thanks
    Arun

    Perhaps you can something like what is described in the support note "How To Load A PDF File Or Other Binary Files To a BLOB Column From ODI (Doc ID 1412753.1)"

  • How to extract unique words in all files

    Hi,
    I am trying to extract all the UNIQUE words of all the files in a directory. well it gives me all the words but along with that all the single letters(alphabets and also repetitions of the same ) and also the output is not unique. I dont want the alphabets only unique words in the files. [Like for example if I encounter file x with words "cat mat sat" and then file y with words "cat mat bat pat". My output should be "cat mat sat bat pat"]
    Can you please let me know what is used to get the unique words only? Or how I can modify my code to get the desired output...
    //String input = "Input text, with words, punctuation, etc. Well, it's rather short.";
                   Pattern p = Pattern.compile("[\\w']+",Pattern.MULTILINE);
                   FileInputStream fis = new FileInputStream(file);
                 FileChannel fc = fis.getChannel();
                 ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, (int)fc.size());
                 Charset cs = Charset.forName("8859_1");
                 CharsetDecoder cd = cs.newDecoder();
                 CharBuffer cb = cd.decode(bb);
                 // Run some matches
                 Matcher m = p.matcher(cb);
                   while ( m.find() ) {
                       //System.out.println(cb.substring(m.start(), m.end()));
                       System.out.println(m.group());
                    Thanks

    Can you tell me how to add the contents of a file into a set?
       import java.io.*;
    import java.util.*;
    public class RmDup{
         public static void main(String args[]){
                   FileReader fr = new FileReader("Dups.txt");
                   BufferedReader br = new BufferedReader(fr);
                   String s1[]=br.readLine();
                   String s2;
                   while ((s2=br.readLine())!=null){
                    HashSet ref = new HashSet( s1 ); // create a HashSet
                    Iterator i = ref.iterator(); // get iterator
                    System.out.println( "\nNonduplicates are: " );
                    while ( i.hasNext() )
                         System.out.print( i.next() + " " );
                    System.out.println();
    }I am trying using this: but getting errors 1: incompatible types and 2:cannot find symbol constructor HashSet(java.lang.String[]).
    Thanks

  • How to extract Oracle data into Excel file?

    For a small automation project I have to extract data from a table/
    tables and append it to the existing excel file and feed that excel
    file to a command that will load data into some other environment. I
    am totally new to this. So to get started I wanted to know,
    1) How to extract data from sample table Foo which has columns A,B,C
    and append these values as new columns to an existing excel say
    fooresults.csv ?
    2) Can I achieve this in pl/sql script or do I need to write unix or
    perl script or some other programing language, please advise?

    The "extract data from a table" part is easy, you could do that with VB/ADO, or .NET/ODP.NET. It's then a matter of taking that data and appending it to a spreadsheet that might be the hard part, and how you'd do that exactly is really more of a Microsoft question than an Oracle one.
    If you want to be able to do this from the database itself and your database is on Windows, you could use either [.NET Stored Procedures|http://www.oracle.com/technology/tech/dotnet/ode/index.html] if you can manipulate the spreadsheet in .net code, or you could also use Oracle's [COM Automation Feature|http://www.oracle.com/technology/tech/windows/com_auto/index.html] if you're handy with the COM object model for Excel.
    How you'd do that exactly via either .net or com or vb is the crux of the problem and is something you'd need to know before it turns into an Oracle question, but if you already know how to do that and now just need to figure out a way to do that from Oracle, either of the above might help.
    Hope it helps,
    Greg

  • How to extract Slide data in 3rd part application from clipboard

    I need to be able to copy/paste or drag/drop from PowerPoint into another application (C# WPF). In my OnDrop method the DragEventArgs Data has these formats:
            [0]    "Preferred DropEffect"    string
            [1]    "InShellDragLoop"    string
            [2]    "PowerPoint 12.0 Internal Slides"    string
            [3]    "ActiveClipBoard"    string
            [4]    "PowerPoint 14.0 Slides Package"    string
            [5]    "Embedded Object"    string
            [6]    "Link Source"    string
            [7]    "Object Descriptor"    string
            [8]    "Link Source Descriptor"    string
            [9]    "PNG"    string
            [10]    "JFIF"    string
            [11]    "GIF"    string
            [12]    "Bitmap"    string
            [13]    "System.Drawing.Bitmap"    string
            [14]    "System.Windows.Media.Imaging.BitmapSource"    string
            [15]    "EnhancedMetafile"    string
            [16]    "System.Drawing.Imaging.Metafile"    string
            [17]    "MetaFilePict"    string
            [18]    "PowerPoint 12.0 Internal Theme"    string
            [19]    "PowerPoint 12.0 Internal Color Scheme"    string
    The "PowerPoint 14.0 Slides Package" is a byte array... can this be converted into Slides?
    If not how would I go about getting high-resolution images + slide text from a drag/drop?
    [Originally posted here: http://answers.microsoft.com/en-us/office/forum/office_2013_release-powerpoint/how-to-extract-slide-data-in-3rd-part-application/a0b5ed64-eb77-49bb-bf44-e0732e23a5eb]

    What I'd like to do:
    Open PowerPoint
    In PPT open a presentation
    In PPT select a slide
    Drag it to my 3rd party WPF application
    In the 3rd party WPF application drop handler get the slide data (text, background image, etc...).
    When I do this I get the DragEventArgs Data (the clipboard data) and it has the 20 supported formats I listed in the 1st post. From these formats #4 seemed like it could have some useful info.
    WPF
    <Window x:Class="PowerPointDropSlide.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525" AllowDrop="True" Drop="UIElement_OnDrop" DragOver="UIElement_OnDragOver">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="LightBlue">
    <TextBlock Text="Drop something here!"/>
    </Grid>
    </Window>
    Handlers:
    public void UIElement_OnDragOver(object sender, DragEventArgs e)
    public void UIElement_OnDrop(object sender, DragEventArgs e)
    string[] supportedFormats = e.Data.GetFormats();
    object pptSlidesPackage = e.Data.GetData("PowerPoint 14.0 Slides Package");

  • Can BPEL handle file attachment from oracle database?

    Hello All,
    Need some help for this below incident.
    1. user attach a file from Human Task Work List. (this will store the attachment into the database)
    2. Get the attachment from the database.
    3. Sent it via email as attachment. (attachment can be all types of file format)
    Question.
    1. Is this possible to be done?
    2. I manage to decode and sent successful as an attachment in .txt format only. But for others i can't, any idea? i get this error in my flow (XML Parsing Error: reference to invalid character number)
    your help will helped others as well. Thanks

    Hei all.
    I get it works already. Direct copy the content from the database with the email content body.
    Problem is:
    1. PDF with large size will fail. (That's why I keep on getting error) but anyone out there know whats the size of the limit?
    2. It wont work for Text file. Its shows base64 format. I not sure why this is happen. But this can be fix with a base64 encoder.

  • How can i send multiple Key note files attached in one e-mail

    I've problem with mail attachment. I want to send multiple files from keynote as 4 attached in one mail. Anyone know how? Do I've to wasting time send it one by one? Your kind advice will be a lot appreciated. Thank you ;)

    You can only email one file at a time from the app. Unless you can copy and paste all four files into the email, you can't do it in the Mail App either. There is a third party app called Group Email with Attachments that will allow you to do this. You will have to be running iOS 4 to attach documents I believe.
    Message was edited by: Demo

  • How to Extract data to a Flat File?

    Hello,
    Im using OWB 10g and Oracle 9.2 version of database. I want to know the complete steps of creating the flat file as my target module. I need to extract the data (source) from the oracle tables and load it into the flat files. Pls let me know your suggestions. Pls note except the flat files, I do not have any oracle tables as my targets.
    Thanks,
    Kishan

    Hi, here's an excerpt from some notes I wrote a few months ago, they shpoud be clear enough.
    0) the file will be created on the server using the utl_file package. So the path where the file will be created must be added to the utl_file_dir Oracle Server parameter. Request your DBA to complete this step.
    -In OWB client:
    1) create a file location (or use existing one) under "Files/Locations" in project tree
    2) create a new Flat File module (or use existing one) under "Files" ; associate it with the desired location (not really necessary)
    3) create a new mapping in an Oracle module
    4) add to mapping a table operator bound to the table to dump
    5) add to mapping un unbound Flat File (FF) Operator, give it a meaningful name
    6) drag the desired attributes from table to FF Operator. This will instruct OWB to feed the file with comma-separated values from the source table using the utl_file package. Be careful to format attributes accordingly to the format you want.
    7) reconcile outbound the FF Operator, creating a new flat file in the module created during step 2
    8) close mapping, right-click on it an from menu "Configure..."->"Sources&Targets"-><YOURTARGETFILE>, specify the desired output location and the output file name
    9) Open deployment manager and connect to runtime rep. If the FF location is new, register it by right-clicking+menu "Register" and specify parameters: operating system user/passawrd of the DB server, host and path where the file will be stored (must be the same added to utl_file_dir). ATTENTION: path info is stored in the generated mapping so be sure to redeploy mappings if changes occur
    10) deploy mapping, test execution
    11) OPTIONAL you can specify a different delimiter (TAB,etc) for the target file directly in its editor. But be careful then to reconcile inbound the FF op in the mapping before deploying.
    Cheers, Antonio

  • How self extract the gui640_20-10001615.exe  file

    Hi Guru,
    I have downloaded the gui640_20-10001615.exe from Service.sap.com site. but its icon shows like Notepad when i try to open it open with note pad. Same when i try ti open in different machine it ask open with options.
    What is the next step after down load this file.
    Regards
    Tapovardhan

    Hi,
    The files no longer need to be extracted.  If you wanted to apply this patch to a single machine you would simply execute it (double click on it) on the machine.  If you wanted to patch an Installation Server, you would launch SAPAdmin and apply the patch with it. 
    What extension did you save teh downlaod with?  It should end in .EXE
    Regards,
    John

  • How to extract the contents fo .xsl files

    wanna source code to extract and Modify the contents of .xsl files

    Duplicate of http://forum.java.sun.com/thread.jspa?threadID=635711&tstart=0

  • How to extract an integer or a float value from a String of characters

    Hi i have a problem getting to a float value within a string of characters..
    for instance the string is
    "numberItem xxxxxxxxx 700.0" (each x is a space..the forum wouldnt let me put normal spaces for some reason)
    how do i store 700.0 in a float variable
    remember the string is obtained from an inputfile
    so far i got the program to store the inputfile data line by line in a String array..i tried tokenizing the string to get to the the float value but since i have mulitple spaces within my string, the token method only gets "numberItem" from the above String
    This is all i have so far:
    String c;
    String Array[] =new String[g]; (i used a while loop to obtain g(the nubmer of lines in the file))
    while((c=(cr.readLine()))!=null)
    Array[coun]=c;
    it would be reallllllllllllllllllllllllllllllllllllllly easy if there was a predefined method to extract numeric values from a string in java..
    Edited by: badmash on Feb 18, 2009 5:50 PM
    Edited by: badmash on Feb 18, 2009 5:50 PM
    Edited by: badmash on Feb 18, 2009 5:55 PM

    badmash wrote:
    Hi i have a problem getting to a float value within a string of characters..
    for instance the string is
    "numberItem xxxxxxxxx 700.0" (each x is a space..the forum wouldnt let me put normal spaces for some reason)
    with the space included
    how do i store 700.0 in a float variable
    remember the string is obtained from an inputfile
    so far i got the program to store the inputfile data line by line in a String array..i tried tokenizing the string to get to the the float value but since i have mulitple spaces within my string, the token method only gets "numberItem" from the above StringHuh?
    Not true.
    Anyway why not use string split, split on spaces and grab the last element (which by the format you posted would be your 700.0)
    Then there is the Float.parseFloat method.
    It is easy.
    And another thing why not use a List of Strings if you want to store each line? (And why did you post that code which doesn't really have anything to do with your problem?) Also in future please use the code formatting tags when posting code. Select the code you are posting in the message box and click the CODE button.

  • How to extract non-sap data (A/R Invoices from Legacy system) into SAP ICR

    Hi
    We are trying to bring A/R invoices from a legacy system into SAP ICR special ledger so that ICR tool can be used these items for intercompany reconcilliation. Could you please let's know the way to load these legacy AR invoice items into ICR data base using any function moduels.
    Regards,
    Eswar.

    Hello Eswar,
    In what form do you have these "external" open items? If they are contained in a file you should simply import the file in ICR during data selection using the File Upload functionality. There is no need to store them in a special purpose ledger first. Actually you would have to create a BADI implementation to extract the data from that special purpose ledger during data selection. Please consider using File Upload standard functionality.
    If for some reason this cannot be used you could implement a logic calling RFC enabled function module FB_ICRC_ADD_DATA_RFC which will take the open items you are supplying in your logic and push them into the ICR database. This strategy could be used to include these external open items without them being processed during data selection.
    Best regards,
    Ralph

  • How do I restore time machine alias files cloned from broken hard drive

    My external hard drive broke (a tiny transistor broke off after the drive fell two feet to the floor) so I purchased a new one and had the Geek Squad clone what was on my old hard drive onto my new one. I was using Time Machine to backup my files. My external hard drive had a much larger capacity than my macbook pro, so I deleted a number of the files saved on my Macbook Pro, knowing that I could access my files whenever I plugged my ext. hard drive in.
    After plugging my new external hard drive into my computer, however, I am finding only alias files and I do not know how to restore my data so I can access all of the files again.
    Does anyone know how to restore my time machine data from the cloned data I had transferred from my broken external hard drive to my new external hard drive?
    Thanks!

    morrisck wrote:
    An update - I finally took both of my HDs in to an Apple store and they confirmed my fear: only alias files had been transferred from my old drive, meaning Geek Squad charged me $100 for 850 MB of unusable files.
    That has been clear since early in this thread.
    Geek Squad has agreed to retry the process
    Why pay them to do what you don't need done??? Get a refund and buy an enclosure, which you should have anyway for backups.
    but I'm now wishing that I had received more sound advice when I brought the drives into them in the first place.
    Don't know who gave you that advice, but I sure wouldn't trust them with my data!
    The Apple rep. informed me that my HD works perfectly fine and that it just needs a new enclosure (which I can buy for $20 online, as opposed to paying $100 for a data transfer).
    Ummm, the action to take seems very clear to me . . . .

Maybe you are looking for

  • Fatal error installing software photosmart c7250 on windows vista 32 bit

    Issue with Uninstall and Install print driver software on my PC - printer is HP Photosmart all in one C7250 - wireless network hook-up My printer had been working for many years.  Then some of the photo print functionality had stopped working - I sus

  • Enhancement in method LOGICAL_SYSTEM_GET_NEW class /SAPSRM/CL_PDO_BO_SC

    Hello all, I am working in SRM 7.0 with a classic scenario and I need to create an especial situation when we can create stock material in SRM with this scenario. SAP proposed that we can do an enhancement in method LOGICAL_SYSTEM_GET_NEW for class /

  • CC 2014 Updates on Mac- Remove Old CC Apps?

    When I installed the CC 2014 Updates on my Mac, my old CC apps remained in place. How do I delete the older versions-simply drag their folders to the trash? Or is there another procedure for deleting them? After once going through hell with Adobe ove

  • Adding photos to .Mac gallery....Auto add to iphoto?

    I have created a web gallery via iphoto '08. A family member has added their photos from the trip (their upload experience was perfect... FYI) . What I'm needing to know is will those photos automatically be added to my iphoto '08 library.....or just

  • SQL on Server 2012 Essentials

    What are the options and/or limits for running SQL server (Standard or Express, 2012 or 2008 or 2005) on Server 2012 Essentials? Thank you.