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

Similar Messages

  • I need to move email from windows notebook, outlook to mac mail on my new macbook pro

    i need to move email from windows notebook-outlook to mac
    mail? need help?

    Hi Linc, I started setting up my new computer a few months ago so don't remember the details.  I did not use migration assistant, nor do I wish to, I believe it was set up through icloud.   Now that I needed my calendar while doing taxes I discover there are no events for 2014 and earlier (except 2 oddly enough).  I do remember that iCloud instructions were not clear as to what would happen in the choices it gave.
    I copied my old user files over from my external back up after my old computer stopped working, was hoping I could put ical folders in the right place to be used by Calendar or import somehow.

  • Need to read data from pipe separated file using POJO?

    Hi,
    I need to read data from pipe separated file using POJO.
    There is config.properties file which consists of the
    data mapping.
    Can you help me with sample code or help?
    Regards
    Regards
    Taton
    Edited by: Taton on Mar 7, 2009 4:41 PM

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Read data from Excel and write into oracle database

    Hi
    I want  to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
    Thanks and Regards
    Neeta

    Hai,
    I am suggesting the solution.
    I will try out and let u know soon.
    Make a coma separated file from your excel file.
    Assuming that your requirement allows to make a csv file.
    This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
    You do not want to  go via sql Loader?
    For reading the excel file itself do you want java?

  • Removing adobe reader icon from excell and outlook

    How can I permanently remove the adobe reader V9 icon from Excel and Outlook? I used toolbar customize to delete the icons but they come back when I restart the programs.

    Sorry, your question is not clear.  Can you give us the exact wording (or a screenshot) of that notification?
    What is your operating system?

  • Urgently need EwsJavaApi example to read email from exchange, and print text attachment to file.

    Hello,
    I have the below code running using the EwsJavaApi. I need to modify it to read the the first email that matches the search string, and then save it's attachment to a file.... Thank you in advance!!!
    public class EWSDemo {
    * @param args
    public static void main(String[] args)  throws Exception {
    ExchangeService service = new ExchangeService();
     // Provide Crendentials
     ExchangeCredentials credentials = new WebCredentials("[email protected]", "yubbybuddy");
     service.setCredentials(credentials);
     // Set Exchange WebSevice URL
     service.setUrl(new URI("https://outlook.office365.com/EWS/exchange.asmx"));
     // Get five items from mail box
     ItemView view = new ItemView(5);
     // Search Inbox
     FindItemsResults<Item> findResults = service.findItems(WellKnownFolderName.Inbox,"Subject:ROGERDODGER123", view);
     // iterate thru items
     for (Item item : findResults.getItems()) {
      System.out.println(item.getSubject());
      AttachmentCollection myAttachments = item.getAttachments();
      System.out.println(myAttachments.);

    >> I need to modify it to read the the first email that matches the search string
    By first do you mean then newest email to arrive or the oldest email in the Mailbox that matches that string ?
    Exchange returns Items from Newest to oldest by default if you want the older messages then you can use the OrderBy property
    http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.itemview.orderby(v=exchg.80).aspx which should give you the oldest item
    Cheers
    Glen

  • How to send Email with Cc and Bcc using MailPackage

    Hi ,
    we are using Mail Package to send the Email using Mail Adapter.We have a requirement where we need to send Email with Cc and Bcc using Mail Package .
    Can we send Cc and Bcc using Mail Package ?
    Thanks
    Rajesh .

    HI Rajesh,
    There is a standard structure for Receiver Mail adopter which we can get from SAP market Place but it is not provided with CC if u want to use CC then you have to go with Dynamic Configuration.
    DynamicConfiguration configuration = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
    /*any other required fields*/
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Mail", "THeaderCC");
    configuration.put(key, "ccemail @ test.com");
    Regards
    Praveen Reddy
    Edited by: Maareddy Praveen Reddy on Aug 10, 2011 12:17 PM

  • 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.

  • Why "Outlook Express" users can't read email from Mail.app ?

    Why "Outlook Express" users can't read email from Mail.app ? Any explanation ? Select a good format,that's a good explanation,but i can't know each time if our recipients use "Outlook Express".

    There are no completely bug free email clients including the Mail.app and Outlook has its share of bugs for such an old/mature email clients and some glaring ones that MS has been aware of for a long time but has chosen not to do anything about since these do not affect exchanging email with other Outlook users.
    Outlook has always had problems with Mail's RTF and the degree depending on the Windows and Outlook versions used by the recipient.
    Check this link.
    http://homepage.mac.com/thgewecke/woutlook.html

  • I have an iTunes account set up long ago on my home pc. My pc at home is antiquated and I can't interface with my account to edit acc. Info. Now I have other devices, iPhone 4 and iPad. I need to reset email apple Id and pw from iPad. How?

    I have an iTunes account set up long ago on my home pc. My pc at home is antiquated and I can't interface with my account to edit acc. Info. Now I have other devices, iPhone 4 and iPad. I need to reset email apple Id and pw from iPad. How? Should I just create new account? Don't want to lose 1500 songs.

    Hey Frankgates!
    I have an article here that can tell you how to do this:
    Apple ID: If you forget your password
    http://support.apple.com/kb/HT5787
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • Getting inner exception "dtd is prohibited in this xml document exchange" while reading emails from outlook

    Getting error "The response received from the service didn't contain valid XML." with inner exception "dtd is prohibited in this xml document exchange" while reading emails from outlook(Not while reading every mail).
    Can anybody please tell me what might be the issue. Below is the code where I am getting error
    FindItemsResults<Item> RetrievedItems=null ;
    RetrievedItems = service.FindItems(FIds, new ItemView(4));
    String[] SignatureList = ConfigurationManager.AppSettings.Get("SignatureTypes").Split(',');
    if (RetrievedItems != null && RetrievedItems.Count() > 0)
    RetrievedItems.ToList().ForEach(x =>
    try
    List<String> Attachments = new List<String>();
    List<String> ScanFileName = new List<String>();
    bool IsAvailable = true;
    //Getting error while Load() - below line of code
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Load();
    Vo.EmailMessage msg = new Vo.EmailMessage();
    msg.MessageId = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Id.UniqueId;
    msg.From = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).From.Address;
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).ToRecipients.ToList().ForEach(z => msg.To += z.Address + ",");
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).ReplyTo.ToList().ForEach(y => msg.ReplyToEmailAddress += y.Address + ",");
    msg.Subject = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Subject;
    msg.Body = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Body.Text;
    msg.Dated = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).DateTimeSent;
    Please help.

    Hi,
    Thank you for your post.
    This is a quick note to let you know that we are performing research on this issue.
    Niko Cheng
    TechNet Community Support

  • I have a MACBook and need to read documents from the govenment. Where do i get Pure edge viewer or something that will work?v

    I have a MACBook and need to read documents from the government. Where do I get Pure edge viewer or something that will work?  I have Adobe already.

    Try this page http://net4geeks.com/index.php?option=com_content&task=view&id=69&Itemid=13

  • How can I save email from GS3 to outlook folders at office?

    Blackberry had a handy feature in which you could save email from BB to Outlook folders on the office computer. I cannot find anything similar on the GS3. Is there a way to accomplish this?

    BB created a dedicated network connection to handle transactions like that to keep it secure, Android doesn't have anything like that so you have to trust a 3rd party company to do this for you and at this time I do not think there is any that has a secure method of doing this.

  • Reading emails from gmail by labview

    I easily found a sample program to send an email to Gmail in LabVIEW and it works well. But I want to read emails from Gmail in LabVIEW as well. Is this possible? Thanks
    Jay
    Solved!
    Go to Solution.

    Well, not so much a duplicate post, since that post was asking about reading attachments. This is asking about getting emails from Gmail.
    To OP: Your question is not clear. Are you trying to download emails from your Gmail account? If so, you first need to configure Gmail to turn on the POP service. I don't think this is enabled by default. The Gmail help documents tell you how to do this. Once you've done that, you can just use a POP client. You can start by trying the one posted in this thread, but be aware, that sometimes servers have their own little "quirks", as alluded to in that thread.

  • Need to read data from a text file

    I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for