Moyosoft Products | Services | Download | Contact us    
Java Bridge to Exchange
Products  >  Java Bridge to Exchange  >  API Reference    
API Reference
   
Overview  |  
Classic JavaDoc

Interface ExchangeMail

com.moyosoft.exchange.mail.ExchangeMail

Implemented Interfaces:
Direct Known Subclasses:

public interface ExchangeMail implements ExchangeItem

Represents an e-mail message stored in an Exchange folder.

A new e-mail can be created with the method ExchangeFolder.createMail(). To save the new e-mail to the folder, call the method save().

This class provides getter and setter methods to access or modify the message's properties.

Example code that displays e-mails from the Inbox received in the past 24 hours:

Exchange exchange = new Exchange("hostname", "username", "password");
ExchangeFolder inbox = exchange.getInboxFolder();

Date now = new Date();
Date oneDayAgo = new Date(now.getTime() - 86400000);

Restriction restriction =
  If.Item.DateTimeReceived.isAfterOrEqualTo(oneDayAgo).and().isBefore(now);

ItemsCollection items = inbox.getItems().
  restrict(restriction).sortBy(ExchangeItemField.item_DateTimeReceived);

System.out.println("E-mails found: " + items.getCount());

for(ExchangeItem item : items)
{
  ExchangeMail mail = (ExchangeMail) item;
  System.out.println(mail.getSubject());
}

See Also:

Methods

void
addBccRecipient (String emailAddress)
void
addCcRecipient (String emailAddress)
void
addReplyTo (String emailAddress)
void
addToRecipient (String emailAddress)
forward ()
java.util.List
getBccRecipientsMailboxes ()
java.util.List
getCcRecipientsMailboxes ()
byte
getConversationIndex ()
String
getConversationTopic ()
String
getFromEmailAddress ()
getFromMailbox ()
String
getFromName ()
String
getInternetMessageId ()
getReceivedByMailbox ()
getReceivedRepresentingMailbox ()
String
getReferences ()
java.util.List
getReplyToMailboxes ()
String
getSenderEmailAddress ()
getSenderMailbox ()
String
getSenderName ()
java.util.List
getToRecipientsMailboxes ()
boolean
isDeliveryReceiptRequested ()
boolean
isRead ()
boolean
isReadReceiptRequested ()
boolean
isResponseRequested ()
reply ()
Creates a reply to this email message. To send the created reply, the method send() has to be called on the returned ExchangeMail object.
replyAll ()
void
send ()
Sends this email message.
void
setBccRecipient (String emailAddress)
void
setBccRecipients (java.util.List emailAddresses)
void
setCcRecipient (String emailAddress)
void
setCcRecipients (java.util.List emailAddresses)
void
setConversationTopic (String conversationTopic)
void
setFrom (String from)
void
setInternetMessageId (String internetMessageId)
void
setIsDeliveryReceiptRequested (boolean isDeliveryReceiptRequested)
void
setIsRead (boolean isRead)
void
setIsReadReceiptRequested (boolean isReadReceiptRequested)
void
setIsResponseRequested (boolean isResponseRequested)
void
setReferences (String references)
void
setReplyTo (java.util.List emailAddresses)
void
setReplyTo (String emailAddress)
void
setToRecipient (String emailAddress)
void
setToRecipients (java.util.List emailAddresses)

Community comments



Powered by JavaDocPlus