Moyosoft Products | Services | Download | Contact us    
Java Bridge to Exchange
import com.moyosoft.exchange.*;
import com.moyosoft.exchange.contact.*;
import com.moyosoft.exchange.folder.*;
import com.moyosoft.exchange.item.*;

public class DisplayContacts
{
  public static void main(String[] argsthrows ExchangeServiceException
  {
    // To provide hostname and credentials information, use:
    // Exchange exchange = new Exchange("hostname", "username", "password");
    Exchange exchange = ExchangeConnectionDialog.display();
    
    if(exchange == null)
    {
      return;
    }

    // Get the default Contacts folder
    ExchangeFolder folder = exchange.getContactsFolder();

    // Display all the contacts in the folder:
    for(ExchangeItem item : folder.getItems())
    {
      ExchangeContact contact = (ExchangeContactitem;

      System.out.println("First name: " + contact.getFirstName());
      System.out.println("Last name: " + contact.getLastName());
      System.out.println("Company: " + contact.getCompanyName());
      System.out.println();
    }
  }
}