Java Libray to extract email Contact Only from Outlook file

P

pcouas

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
 
R

Roedy Green

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

John

Roedy said:
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
 
R

Rogan Dawes

Roedy said:
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
 
P

pcouas

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

Philippe
 
P

pcouas

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);
}
}
}
 
Joined
Dec 31, 2008
Messages
3
Reaction score
0
how to read .pst file by java

can you please give example code to get and read the .pst file.?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top