Java Libray to extract email Contact Only from Outlook file

Discussion in 'Java' started by pcouas, Oct 28, 2005.

  1. pcouas

    pcouas Guest

    Hi,

    Does anyone know of a Java library that can extract email contact ONLY
    from Outlook .pst files.
    I just need to get email list from pst file in real time for my Java
    Applet.


    Regards
    Philippe
    pcouas, Oct 28, 2005
    #1
    1. Advertising

  2. pcouas

    Roedy Green Guest

    On 28 Oct 2005 00:45:41 -0700, "pcouas" <> wrote,
    quoted or indirectly quoted someone who said :

    >Does anyone know of a Java library that can extract email contact ONLY
    >from Outlook .pst files.
    >I just need to get email list from pst file in real time for my Java
    >Applet.


    If you can't find what you want, perhaps Outlook has some export
    format that is more tractable.

    The format looks to be unusually opaque to figuring it out by
    experiment.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Oct 28, 2005
    #2
    1. Advertising

  3. pcouas

    John Guest

    Roedy Green wrote:

    > The format looks to be unusually opaque to figuring it out by
    > experiment.


    You can post that again! PST is a nightmare format. All of the tools
    that I've seen for converting it only work in a patchy way.

    The best way to do it AFAIK is to upload the files to an IMAP server
    using outlook and then download them using a proper email client.

    For the OP's problem, perhaps he could either convert the files ahead of
    time in this way, or somehow incorporate a live IMAP server and just
    access the mail from there.

    John
    John, Oct 28, 2005
    #3
  4. pcouas

    Rogan Dawes Guest

    Roedy Green wrote:
    > On 28 Oct 2005 00:45:41 -0700, "pcouas" <> wrote,
    > quoted or indirectly quoted someone who said :
    >
    >
    >>Does anyone know of a Java library that can extract email contact ONLY

    >
    >>from Outlook .pst files.

    >
    >>I just need to get email list from pst file in real time for my Java
    >>Applet.

    >
    >
    > If you can't find what you want, perhaps Outlook has some export
    > format that is more tractable.
    >
    > The format looks to be unusually opaque to figuring it out by
    > experiment.


    Note that you'd have to use a signed applet to get access to the PST in
    the first place. Disregarding entirely the fact that the address book is
    typically not stored in the PST in the first place, but rather a .PAB file.

    It sounds to me like you want your applet to be able to send email on
    the user's behalf. But if the user is using outlook, you may have to
    send email via MAPI (not IMAP), which, as far as I know, has ZERO
    support in Java.

    I'd suggest looking at this in a different way, if at all possible.

    Perhaps you can simply present a mailto: link, and let the user just
    click on it to send an email? Outlook can automatically resolve email
    links like

    mailto:bloggs, joe

    using the address book, so that might work for you.

    Rogan
    Rogan Dawes, Oct 28, 2005
    #4
  5. pcouas

    pcouas Guest

    "Mail to", could not transfert attachement ?
    I want, reading adress from outlook and sending mail from my Signed
    Applet ?

    Philippe
    pcouas, Oct 28, 2005
    #5
  6. pcouas

    Dave Guest

    Not sure about your budget, but I found this is good for dealing with
    outlook appointments, contacts, etc...

    http://www.kova-solutions.com/joc/

    pcouas wrote:
    > "Mail to", could not transfert attachement ?
    > I want, reading adress from outlook and sending mail from my Signed
    > Applet ?
    >
    > Philippe
    Dave, Oct 29, 2005
    #6
  7. pcouas

    pcouas Guest

    I have found a solution with OpenSource Project Jacob

    package Activex01;

    import com.jacob.activeX.*;
    import com.jacob.com.*;


    public class getContacts {
    public static void main(String[] args) {
    final int olFolderContacts = 10;

    ActiveXComponent ol = new ActiveXComponent("Outlook.Application");
    Dispatch dsp = new Dispatch();

    Dispatch olo = ol.getObject();
    Dispatch myNamespace = Dispatch.call(olo, "GetNamespace",
    "MAPI").toDispatch();
    Dispatch myFolder = Dispatch.call(myNamespace, "GetDefaultFolder",new
    Integer(olFolderContacts)).toDispatch();

    //nächste zeile Fehlermeldung

    Dispatch items = Dispatch.get(myFolder, "Items").toDispatch();

    int count = Dispatch.call(items, "Count").toInt();

    for (int i = 1; i <= count; i++) {
    Dispatch item;
    item = Dispatch.call(items, "Item", new Integer(i)).toDispatch();

    String fullName = Dispatch.get(item, "Fullname").toString();
    String emailAddress = Dispatch.get(item, "Email1Address").toString();
    String addressStreet = Dispatch.get(item, "BusinessAddressStreet")
    ..toString();
    String addressCity = Dispatch.get(item, "BusinessAddressCity")
    ..toString();
    String addressCountry = Dispatch.get(item, "BusinessAddressCountry")
    ..toString();
    String addressPostalCode = Dispatch.get(item,
    "BusinessAddressPostalCode").toString();
    String addressState = Dispatch.get(item, "BusinessAddressState")
    ..toString();
    String title = Dispatch.get(item, "Title").toString();
    String phone = Dispatch.get(item, "BusinessTelephoneNumber")
    ..toString();
    String fax = Dispatch.get(item, "BusinessFaxNumber").toString();

    printField("", fullName);
    printField("", title);
    printField("", addressStreet);
    printField("", addressCity);
    printField("", addressState);
    printField("", addressPostalCode);
    printField("", addressCountry);
    printField("Tel:", phone);
    printField("Fax:", fax);
    printField("Email:", emailAddress);

    System.out.println();
    }
    }

    public static void printField(String label, String value) {
    if (value.length() != 0) {
    System.out.println(label + " " + value);
    }
    }
    }
    pcouas, Oct 31, 2005
    #7
  8. pcouas

    praitheesh

    Joined:
    Dec 31, 2008
    Messages:
    3
    how to read .pst file by java

    can you please give example code to get and read the .pst file.?
    praitheesh, Jul 8, 2009
    #8
  9. pcouas

    Denis_IBM

    Joined:
    Dec 18, 2010
    Messages:
    2
    You should try JPST

    Go to: independentsoft.de/jpst
    Denis_IBM, Dec 18, 2010
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hugo
    Replies:
    1
    Views:
    360
    Thomas Matthews
    Aug 16, 2004
  2. B.C.
    Replies:
    4
    Views:
    15,133
    Howard
    Nov 6, 2004
  3. news.videotron.ca
    Replies:
    1
    Views:
    4,774
    Victor Bazarov
    Feb 10, 2005
  4. Brynn
    Replies:
    1
    Views:
    537
    Brynn
    Jan 19, 2004
Loading...

Share This Page