Read email from microsoft exchangeserver 2010 and save attachement

Hello,
I want to read email from microsoft exchangeserver 2010 and save attachement into a folder.I created an Java program to import attachments from a exchange server mailbox using "POP3S".It works fine when run as a java application.But when i put this inside Oracle11g R2 using load java and while executing from a procedure it gives an error at parsing message into Multipart
Error at line : Multipart mp = (Multipart)m.getContent();
Error:
Content-Type: multipart/mixed;
boundary="_002_A0C2E09A..................................."
java.lang.ClassCastException
at mailPop3.checkmail(mailPop3:71)
My Java Class is as follows,
import java.io.*;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.Date;
The function i used to check for attachments is given below.
public static boolean hasAttachments(Message m) throws java.io.IOException, MessagingException
Boolean hasAttachments = false;
try
// if it is a plain/html text - no attachements
if (m.isMimeType("text/*"))
return hasAttachments;
else if (m.isMimeType("multipart/alternative"))
return hasAttachments;
else if (m.isMimeType("multipart/*"))
Multipart mp = (Multipart)m.getContent();
if (mp.getCount() > 1)
hasAttachments = true;
return hasAttachments;
catch (Exception e) {
e.printStackTrace();
} finally {
return hasAttachments;
My Java Details as follows
java Version :1.5.0_10
java.vm.specification.version:1.0
java.vm.version :1.5.0_01
java.specification.version:1.5
java.class.version:48.0
Java mail API:javamail-1.4.4
Used Jars:mail.jar
Could someone explain why I am getting this error? What can I do to resolve this error?
Is any other Jar need other than mail.jar?
Any help would be much appreciated.
Regards,
Nisanth

889509 wrote:
This java class has no error.Then it should work - not only at compile time, but at run-time too.
Because it does not, it means there are errors. And as the error you've posted is not an Oracle SQL or PL/SQL error, your question is off-topic to this forum.
Why would the code not work at run-time? Numerous reasons, including environmental ones. Java inside Oracle are subjected to a number of restrictions and limitations that do not exist in a Java VM outside Oracle (for good reasons).
So you need to consider that too - and that is why I referred you to the documentation... which is IMO mandatory reading for all Oracle developers.

Similar Messages

  • How to read emails from Microsoft Exchange Server

    I have microsoft exchange server and I want to read emails from microsoft exchange server. There is no POP3 server. So is it possible?
    If it is possible to read emails from microsoft exchange server then please give me some idea.
    Thanks
    Santanu

    santanu wrote:
    Hi,
    My company is using Microsoft exchange server.
    IMPA and POP3 has been disabled, but my requirement is I wan to read email.Then ask the administrator of the server to enable IMAP. If you have a valid business requirement to do that, there would be no reason for the administrator to refuse.

  • What all sofware is required to develop a userinterface.vi to read data from a data logger and save in a file

    hi,
    i am working on creating a GUI.vi to read data from the datalogger and the same should be used to set the date ,time,etc.i am thinking of using VISA to read data through serial port(COM1),that interface is available.but when i tried to read data from the logger i am getting timeout error.what should i do ?i am using the example given with labview 7.0 .can any one suggest me what all things i need to do if i want to read datalogger to a file.Is there any one who workrd on this.please reply me as early as possible,
    bye
    vbkraju

    You're welcome--I'm happy to help.
    The LabVIEW <-> Serial.vi is a good example that allows for writing commands to an instrument and reading back from it using a VISA Session. One of the inputs on this VI is the Resource Name. You need to ensure that the name of your serial port is in this drop down menu, so that the program is sending and receiving data from the correct place.
    The VI is setup so that you can send a command to the external device, and then receive data back. I am not sure about the Spectrum 4000, but most devices have commands that they receive to tell the device which data to send back over the serial port. The VI has a default string to write of *IDN?, which is a common command that tells the instrument to return an ident
    ity string. The fact that the program is timing out for you indicates that the program never received any data from the device. Either the device is not configured to automatically send data, or the correct command is not being sent to the device. Your datalogger manual may be able to help you determine what serial commands it needs to receive to send the data out you expect.
    I hope this will get you further along in your application.
    John M

  • When I save a document in Microsoft Word 2010 and then open it, I am unable to read it

    When I save a document in Microsoft Word 2010 and then open it, I am unable to read it because it is gibberish with all kinds of symbols and numbers.  I understand it has something to do with Adobe Reader.  Has anyone else had this problem and how do I correct it?

    Put your cursor on the icon of one of your scanned documents. Click on the right button of your mouse. In the list that will appear, put your cursor on Properties and click on the left button of your mouse. In the window that you'll get, read and make a note of what you see next to "File type" and "Opens with". Then post here what you saw.
    If you don't understand these instructions, please ask for more details.

  • I've received a gmail email from Microsoft account team saying We detected something unusual about a recent sign-in to the Microsoft account ******* To help keep you safe, we required an extra security challenge. I then asks to follow link and sign in

    Please help because since I've received an email from Microsoft warning they have detected suspicious activity on our Microsoft email account (wasn't even aware my gmail account had anything to do with Microsoft) I have been receiving other odd emails which consist of one or two huge lines of text in bright blue, usually to do with debt or one the Grand National and betting. These emails do no appear to be addressed to me but I'm still receiving them. I have put them all into the Junk Folder (by the way is that the same as reporting them as spam on and iPhone or iPad?)
    I'm still concerned about this Microsoft email though. It advises that we need to give some extra security information for them to be able to protect us in future (which initially looked to me as if it may be a phishing email). If I follow the link it takes me to a page that looks fairly official and could well be Microsoft, I then asks me to sign in using username and password.
    To be honest Im not sure I even have a Microsoft username or password and I'm concerned even if I did know it, whether I should be filling in that information or not? Also what's likely to happen once I've signed in? I'm concerned that once I had entered their site they would just be phishing for more information?
    Just in case there is any relevance around about the time of receiving this email I and performed two fairly unusual actions.
    1.  I contacted an American company to ask if they would sell something to the UK.
    2.  I started using Keychain on my iPhone and iPad and signed in to all the shops and sites I use with my usual password and changed them all the keychain suggested passwords.
    Typical trying to make myself safer and yet I'm now concerned I could be in danger. 
    Please can someone advise me on what I should do about this email, i,e, is it a phishing mail and should I Junk it or should I answer it and try and sign in and if I should answer it how do I know what my Microsoft sign in and password is? 
    Also can someone tell me how I report spam on my iPhone and iPad in a gmail account?
    Sorry I've rattled on so much and I'm asking so many questions but they are all connected.

    Shelady wrote:
    ... (wasn't even aware my gmail account had anything to do with Microsoft) ...
    It doesn't.  Gmail is owned by Google.
    Shelady wrote:
    Also can someone tell me how I report spam on my iPhone and iPad in a gmail account?
    Report it to Google:

  • Need to read Email from Lotusnotes and Outlook using Oracle

    Dear All,
    My database version Oracle 10.2
    I need to read Email from Lotusnotes and Outlook using Oracle.
    I have tried with below link
    http://sourceforge.net/projects/plsqlmailclient/The problem is i am getting some java error.
    Can anyone suggest me to proceed further.
    Cheers,
    San

    I am using the another function to read an email from pop3 server
    create or replace
    FUNCTION pop3 (
       username   VARCHAR2,
       PASSWORD   VARCHAR2,
       msgnum     NUMBER
       RETURN tstrings PIPELINED
    IS
       --POP3_SERVER             constant varchar2(19) := '127.0.0.1';
       pop3_server   CONSTANT VARCHAR2 (100)     := 'xxxxxx';
       pop3_port     CONSTANT NUMBER             := 110;
       --POP3_TIMEOUT            constant number := 10;
       pop3_ok       CONSTANT VARCHAR2 (10)      := '+OK';
       e_pop3_error           EXCEPTION;
       --E_READ_TIMEOUT  exception;
       --pragma exception_init( E_READ_TIMEOUT, -29276 );
       socket                 UTL_TCP.connection;
       line                   VARCHAR2 (30000);
       BYTES                  INTEGER;
       -- send a POP3 command
       -- (we expect each command to respond with a +OK)
       FUNCTION writetopop (command VARCHAR2)
          RETURN VARCHAR2
       IS
          len    INTEGER;
          resp   VARCHAR2 (30000);
       BEGIN
          len := UTL_TCP.write_line (socket, command);
          UTL_TCP.FLUSH (socket);
          -- using a hack to check the popd response
          len := UTL_TCP.read_line (socket, resp);
          IF SUBSTR (resp, 1, 3) != pop3_ok
         THEN
           RAISE e_pop3_error;
          END IF;
          RETURN (resp);
       END;
    BEGIN
    --UTL_TCP.CLOSE_CONNECTION (SOCKET);
       PIPE ROW ('pop3:' || pop3_server || ' port:' || pop3_port);
       -- Just to make sure there are no previously opened connections
       UTL_TCP.close_all_connections;
       -- open a socket connection to the POP3 server
       socket :=
          UTL_TCP.open_connection (remote_host      => pop3_server,
                                   remote_port      => pop3_port,
                                   --tx_timeout => POP3_TIMEOUT,
                                   CHARSET          => 'US7ASCII'
       -- read the server banner/response from the pop3 daemon
       PIPE ROW (UTL_TCP.get_line (socket));
       -- authenticate with the POP3 server using the USER and PASS commands
       PIPE ROW ('USER ' || username);
       PIPE ROW (writetopop ('USER ' || username));
       PIPE ROW ('PASS ' || PASSWORD);
       PIPE ROW (writetopop ('PASS ' || PASSWORD));
       -- retrieve the specific message
       PIPE ROW ('RETR ' || msgnum);
       PIPE ROW (writetopop ('RETR ' || msgnum));
       --PIPE ROW( 'LIST '||msgNum ); PIPE ROW( WriteToPop('LIST '||msgNum) );
       PIPE ROW ('*** START OF INTERNET MESSAGE BODY ***');
       LOOP
       dbms_output.put_line('entering');
          BYTES := UTL_TCP.available (socket);
         IF BYTES > 0
          THEN
             BYTES := UTL_TCP.read_line (socket, line);
             line := REPLACE (line, CHR (13) || CHR (10), '');
             -- WILL HAVE TO USE PLSQL FUNCTIONS (HAVE BOOKMARKED) TO GET THE MAIL
             -- IN THE PREFERRED FORMAT. CAN USE "REPLACE()"
             IF LENGTH (line) = 1 AND line = '.'
             THEN
                PIPE ROW ('*** END OF INTERNET MESSAGE BODY ***');
             ELSE
                PIPE ROW (line);
             end if;
         END IF;
          EXIT when length (LINE) = 1 and LINE = '.';
          -- PIPE ROW (line);
       END LOOP;
       --PIPE ROW( '*** END OF INTERNET MESSAGE BODY ***' );
       -- close connection
       PIPE ROW ('QUIT');
       PIPE ROW (writetopop ('QUIT'));
       UTL_TCP.CLOSE_CONNECTION (SOCKET);
    EXCEPTION
       WHEN e_pop3_error
       THEN
          PIPE ROW ('There are no mails !');
    END;I am getting the below output .
    21     pop3:sbssld1 port:110
    75     "+OK Lotus Notes POP3 server version Release 8.0.1 ready on SBSSLD1/SBPSS.
    47     USER [email protected]
    69     "+OK [email protected], your papers please.
    13     PASS password
    63     "+OK [email protected] has 1 message.
    6     RETR 1
    17     "+OK 1546 octets
    38     *** START OF INTERNET MESSAGE BODY ***
    9     Subject:
    48     X-KeepSent: A231D6D0:8485FE4B-65257AB1:0022E60F;
    23      type=4; name=$KeepSent
    46     To: [email protected]
    53     X-Mailer: Lotus Notes Release 8.0.1 February 07, 2008
    95     Message-ID: <[email protected]mbnpparibasfs.in>
    48     From: [email protected]
    36     Date: Fri, 9 Nov 2012 11:51:14 +0530
    90     X-MIMETrack: Serialize by POP3 Server on SBSSLD1/SBPSS(Release 8.0.1|February 07, 2008) at
    23      11/09/2012 11:51:21 AM
    17     MIME-Version: 1.0
    37     Content-type: multipart/alternative;
    68     "     Boundary="0__=EABBF022DFB16ED68f9e8a93df938690918cEABBF022DFB16ED6""
    27     Content-Disposition: inline
    (null)     (null)
    58     --0__=EABBF022DFB16ED68f9e8a93df938690918cEABBF022DFB16ED6
    39     Content-type: text/plain; charset=UTF-8
    33     Content-transfer-encoding: base64
    (null)     (null)
    (null)     (null)
    76     DQoNCg0KUmVnYXJkcywNClNoYW5tdWdhbSBOYXRhcmFqYW4uDQpNb2IgOiA5NjI5MjUyNDI1DQpP
    76     ZmYgOiAwNDQgMjI1MDQ3MDAgRXh0biA0Nzc5DQoNCiB+SWYgdGhlIGZhY3RzIGRvbuKAmXQgZml0
    68     IHRoZSB0aGVvcnksIGNoYW5nZSB0aGUgZmFjdHMu4oCdIC0gQWxiZXJ0IEVpbnN0ZWlu
    (null)     (null)
    58     --0__=EABBF022DFB16ED68f9e8a93df938690918cEABBF022DFB16ED6
    38     Content-type: text/html; charset=UTF-8
    27     Content-Disposition: inline
    33     Content-transfer-encoding: base64
    (null)     (null)
    76     PGh0bWw+PGJvZHk+DQo8cD5SZWdhcmRzLDxicj4NClNoYW5tdWdhbSBOYXRhcmFqYW4uPGJyPg0K
    76     TW9iIDogOTYyOTI1MjQyNTxicj4NCk9mZiA6IDA0NCAyMjUwNDcwMCBFeHRuIDQ3Nzk8YnI+DQo8
    76     YnI+DQogfklmIHRoZSBmYWN0cyBkb27igJl0IGZpdCB0aGUgdGhlb3J5LCBjaGFuZ2UgdGhlIGZh
    60     Y3RzLuKAnSAtIEFsYmVydCBFaW5zdGVpbjxicj4NCjwvYm9keT48L2h0bWw+
    (null)     (null)
    60     --0__=EABBF022DFB16ED68f9e8a93df938690918cEABBF022DFB16ED6--
    (null)     (null)
    36     *** END OF INTERNET MESSAGE BODY ***
    4     QUIT
    42     "+OK Lotus Notes POP3 server signing off.
    "Now pls suggest me how can i store the sender mail id, receiver mail id, subject and body of the mail in a table.
    So that i can display the saved data in the above table as a mail in my separate application.
    Thanks in advance.
    Cheers,
    San

  • ICloud will not sync my contacts or calendar in Mac Office 2011. ICloud does however sync to my PC at work running Microsoft office 2010 and also to my IPad and IPhone. Does anyone know how to fix this?

    ICloud will not sync my contacts or calendar in Mac Office 2011. ICloud does however sync to my PC at work running Microsoft office 2010 and also to my IPad and IPhone. Does anyone know how to fix this?

    Welcome to the Apple community.
    Unfortunately Office for Mac does not support the correct protocols to work with iCloud.

  • How can I remove a page from a PDF document and save it as a new PDF document?

    How can I remove a page from a PDF document and save it as a new PDF document?

    Tools - Pages - Extract and tick the option to delete the extracted page from the original file.

  • Reading emails from Faxcom server with javamail 1.4.2

    Our JavaMail-based application reads up to 60,000 emails a day. We recently upgraded to JavaMail 1.4.2 to get more leniency reading poorly formatted messages. So far, it's looking great. We only experienced one issue. Upon upgrading, we stopped being able to receive multiparts sent via Faxcom product. To resolve this, we set the property:
    mail.mime.multipart.ignoreexistingboundaryparameterto "false". If it is set to true, it will not be able to read emails from the Faxcom product that were previously successful using JavaMail 1.4.1. Basically, the API returns zero for the multipart count. If you are setting some of the new leniency parameters, I would recommend keeping this "false" unless it solves some specific problem.
    Just wanted to post this to see if anyone had experienced the same problem, and to share the solution.

    Thanks Bill, I will try setup a simple program to reproduce, or see if I can reproduce with one of the JavaMail sample programs - I also have a FaxCom mailbox setup for testing.
    We are also still having trouble consuming a few messages that have a broken Content Type field:
    08:37:05.996 INFO: (EmailServer.processMultipart-Thread-21) Inside Content Type: text/plain
    name="incoming.txt"
    javax.mail.internet.ParseException: Expected ';', got "NAME"
    at javax.mail.internet.ParameterList.<init>(ParameterList.java:280)
    at javax.mail.internet.ContentType.<init>(ContentType.java:110)
    ...etc..
    I will also look and find out which mail client that came from. Maybe the solution here is trying to ask the sender to fix/upgrade/switch mail clients.
    But other than these 2 occasional problems, 1.4.2 is working great in production and we are getting a lot fewer failures.

  • Developers I need an applescript that opens documents in excel from a specified folder and saves them as .xlsx from their current .xlsb

    mule13470 
    Apr 3, 2014 11:12 AM 
    I tried simply renaming them however it just corrupts the files when I do it like that so I need the applescript to open the files in excel and the save them as .xlsx to test I only need it one folder but if it works I'd like to be able to do it for all documents with .xlsb extentions that are in a huge folder with subfolders that contain a mix of .pdf, .docx, .xlsx and .xlsb. Please Help.
    Applescript Editor, Mac OS X (10.6.8) 
    I have this question too (0) 
    Reply
    Categories: Using OS X MavericksTags: mac, help, finder, excel, applescript_editor
    Level 1 (0 points)
    mule13470
    Re: I need an applescript that opens documents in excel from a specified folder and saves them as .xlsx from their current .xlsbApr 3, 2014 11:19 AM (in response to mule13470) 
    In that huge folder I only need the .xlsb files opened and saved to .xlsx not the others, in case that wasn't clear above.

    In that huge folder I only need the .xlsb files opened and saved to .xlsx not the others, in case that wasn't clear above.

  • Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Acrobat Pro or Standard.

  • How to capture a .gif file from a spectrum analyzer and save the file in PC

    I want to capture a .gif file from a spectrum analyzer and save the file in PC, but I've got a problem when read data from the instrument. I'm not sure how to format the string got from the instrument , When I use "%s" or "%t" as the read string format the data got from the instrument is truncated.
    my code are as follows, could anyone tell me where i am wrong?
    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
     viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%t", resultsArray);
     printf("%s", resultsArray);
     getchar();       
    Solved!
    Go to Solution.
    Attachments:
    readResult.docx ‏50 KB

    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
    viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%b", resultsArray);

  • How can I import my archived emails from Microsoft outlook to my MAC Book Pro using MAC OS?

    How can I import my archived emails from Microsoft outlook to my MAC Book Pro using MAC OS?

    Do you have contacts turned on using the iCloud control panel in Windows control panel?

  • Somehow a new contact became associated with my email.  Now all my email has her name on it. This happens only on my iMac, not on my other Apple devices.  I have removed my email from her contact card and deleted her from previous recipients on Mail.

    Somehow a new contact became associated with my email.  Now all my email has her name on it. This happens only on my iMac, not on my other Apple devices.  I have removed my email from her contact card and deleted her from previous recipients on Mail.

    Check the settings in the Accounts for Mail.
    Mail > Preferences > Accounts > Click on your email Account in the left column > What appears under Full Name in the right column?
    If that is the incorrect name you're describing change it to your correct name.

  • How to download a form from the web, complete and save it?

    How to download a form from the web, complete and save it?

    Download Adobe Reader. If the form author allows filling out digitally, you can do so and save it again.
    Mylenium

Maybe you are looking for

  • Expanding text field to hold data

    This sounds like a pretty simple problem, but... I have created a form using Designer that consists for 4 text boxes that span the width of the page. We are using a middleware product, LogiXML, to populate the form. We have successfully accomplished

  • Error in creating polestar logical indexes

    Hi All, I have an issue. While creating the polestar index for an Infocube the job terminates giving out an error. Error Text Creation of logic Explorer index 'BWP_ZPL_PUR_ps' cancelled. See  for details.  (ZPL_PUR is the cube to be indexed) The cube

  • How to get instance of Class with its type parameters

    Hi, Have any of you folks been dealing with generics long enough to show me how this should be written? Or point me to the answer (I have searched as well as I could). I boiled down my situation to the included sample code, which is long only because

  • When will I get Infinity

    When I enter my postcode on BT Infinity it states my area is already on the list to get it, but I can't find any information to tell me when that will actually happen. When I click order Infinity it says it's not available to me. I'm only assuming it

  • Customer name 1 problem

    Hi sap Guru's i m facing the problem is underthe one account group of that, searching for customer detailes purpocess maintain one customer no in  customers in search popupbox the display without name 1 but give to another no,display the name 1,but a