Moyosoft Products | Services | Download | Contact us    
Java Outlook Connector
Products  >  Java Outlook Connector  >  API Reference    
API Reference
   
Overview  |  
Classic JavaDoc

Class OutlookMail

java.lang.Object
  └ com.moyosoft.connector.ms.outlook.item.OutlookItemcom.moyosoft.connector.ms.outlook.mail.OutlookMail

Implemented Interfaces:

public class OutlookMail extends OutlookItem implements IAttachmentsContainer

Represents an Outlook e-mail item.

For an example on how to send an e-mail, please have a look at this sample application.

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

Constructors

public
OutlookMail (OutlookFolder folder)
Creates a new mail in the specified folder
public
OutlookMail (Outlook outlookApplication)
Creates a new mail in the default outbox folder
public
OutlookMail (com.moyosoft.connector.com.Dispatch dispatch)

Methods

void
clearConversationIndex ()
void
close (InspectorClose saveMode)
createAttachment (java.io.File pAttachmentFile, AttachmentType pType)
forward ()
getAttachments ()
int
getAttachmentsCount ()
String
getBCC ()
String
getBillingInformation ()
String
getBody ()
getBodyFormat ()
The 'BodyFormat' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.
String
getCategories ()
String
getCC ()
String
getCompanies ()
getConflicts ()
String
getConversationIndex ()
String
getConversationTopic ()
java.util.Date
getDeferredDeliveryTime ()
getDownloadState ()
java.util.Date
getExpiryTime ()
java.util.Date
getFlagDueBy ()
getFlagIcon ()
String
getFlagRequest ()
getFlagStatus ()
getFormDescription ()
String
getFrom ()
Returns the address of this e-mail's originator. Returns the same value as the method getSenderAddress.
String
getHTMLBody ()
getImportance ()
getInspector ()
int
getInternetCodepage ()
The 'InternetCodepage' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.
getItemProperties ()
getMarkForDownload ()
String
getMessageClass ()
String
getMileage ()
getPermission ()
getPermissionService ()
String
getReceivedByEntryID ()
String
getReceivedByName ()
String
getReceivedOnBehalfOfEntryID ()
String
getReceivedOnBehalfOfName ()
java.util.Date
getReceivedTime ()
getRecipients ()
String
getReminderSoundFile ()
java.util.Date
getReminderTime ()
getRemoteStatus ()
String
getReplyRecipientNames ()
getReplyRecipients ()
String
getReplyToAddress ()
Returns the Reply-To address of this message.
getReplyToRecipient ()
Returns a recipient object corresponding to the Reply-To address of this message.
getSaveSentMessageFolder ()
getSender ()
Returns the originator of this message as an AddressEntry object.
String
getSenderAddress ()
Returns the address of this e-mail's originator. With the Professional edition of Java Outlook Connector, this method also translate an Exchange type address (type "EX") to an SMTP e-mail address and returns the SMTP address (Outlook 2002 or later).
String
getSenderEmailAddress ()
Deprecated - Use the method getSenderAddress instead The 'SenderEmailAddress' property is only supported by Outlook 2003 or higher. With other versions this method will throw a ComponentObjectModelException. This method has been replaced with the method getSenderAddress.
String
getSenderEmailType ()
The 'SenderEmailType' property is only supported by Outlook 2003 or higher. With other versions this method will throw a ComponentObjectModelException.
String
getSenderName ()
getSendUsingAccount ()
Returns the account used when sending this message. The accounts are only supported by Outlook 2007 or later; with other versions this method will throw an ComponentObjectModelException. This method is only available in the Professional edition of Java Outlook Connector.
getSensitivity ()
java.util.Date
getSentOn ()
String
getSentOnBehalfOfName ()
int
getSize ()
String
getSubject ()
String
getTo ()
String
getTransportMessageHeaders ()
Get the Internet headers from a SMTP message. This method is only available in the Professional edition of Java Outlook Connector.
getType ()
getUserProperties ()
String
getVotingOptions ()
String
getVotingResponse ()
boolean
isAlternateRecipientAllowed ()
boolean
isAutoForwarded ()
boolean
isAutoResolvedWinner ()
The 'AutoResolvedWinner' property is only supported by Outlook 2003 or higher. With other versions this method will throw an ComponentObjectModelException.
boolean
isConflict ()
boolean
isDeleteAfterSubmit ()
boolean
isEnableSharedAttachments ()
boolean
isHasCoverSheet ()
boolean
isIPFax ()
boolean
isNoAging ()
boolean
isOriginatorDeliveryReportRequested ()
boolean
isReadReceiptRequested ()
boolean
isRecipientReassignmentProhibited ()
boolean
isReminderOverrideDefault ()
boolean
isReminderPlaySound ()
boolean
isReminderSet ()
boolean
isSaved ()
boolean
isSent ()
boolean
isSubmitted ()
boolean
isUnRead ()
reply ()
replyAll ()
void
send ()
void
setAlternateRecipientAllowed (boolean value)
void
setAutoForwarded (boolean value)
void
setBCC (String value)
void
setBillingInformation (String value)
void
setBody (String value)
void
setBodyFormat (BodyFormat value)
The 'BodyFormat' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.
void
setCategories (String value)
void
setCC (String value)
void
setCompanies (String value)
void
setDeferredDeliveryTime (java.util.Date value)
void
setDeleteAfterSubmit (boolean value)
void
setEnableSharedAttachments (boolean value)
void
setExpiryTime (java.util.Date value)
void
setFlagDueBy (java.util.Date value)
void
setFlagIcon (FlagIcon value)
void
setFlagRequest (String value)
void
setFlagStatus (FlagStatus value)
void
setHasCoverSheet (boolean value)
void
setHTMLBody (String value)
void
setImportance (ImportanceType value)
void
setInternetCodepage (int value)
The 'InternetCodepage' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.
void
setIsIPFax (boolean value)
void
setMarkForDownload (RemoteStatus value)
void
setMessageClass (String value)
void
setMileage (String value)
void
setNoAging (boolean value)
void
setOriginatorDeliveryReportRequested (boolean value)
void
setPermission (Permission value)
void
setPermissionService (PermissionService value)
void
setReadReceiptRequested (boolean value)
void
setRecipientReassignmentProhibited (boolean value)
void
setReminderOverrideDefault (boolean value)
void
setReminderPlaySound (boolean value)
void
setReminderSet (boolean value)
void
setReminderSoundFile (String value)
void
setReminderTime (java.util.Date value)
void
setRemoteStatus (RemoteStatus value)
void
setSaveSentMessageFolder (OutlookFolder folder)
void
setSendUsingAccount (Account account)
Define the account to be used when sending this message. The accounts are only supported by Outlook 2007 or later; with other versions this method will throw an ComponentObjectModelException. This method is only available in the Professional edition of Java Outlook Connector.
void
setSensitivity (SensitivityType value)
void
setSentOnBehalfOfName (String value)
void
setSubject (String value)
void
setTo (String value)
void
setUnRead (boolean value)
void
setVotingOptions (String value)
void
setVotingResponse (String value)
void
showCategoriesDialog ()

Inherited methods

Community comments


Embbed a picture in the mail body
Vote up  |  Vote down
Outlook outlook = new Outlook();
OutlookMail mail = new OutlookMail(outlook);

mail.setSubject("subject");
mail.setTo("test@example.com");

// Add the picture as attachment:
mail.getAttachments().add(new File("test.gif"));

// Reference the attached picture in the body:
mail.setHTMLBody("<html>This is a picture: " +
  "<img src='cid:test.gif'></html>");

mail.send();
outlook.dispose();

Get the mail signature
Vote up  |  Vote down
Outlook updates the mail's body with the user's signature when the Outlook inspector window is initialized. To do that, call the method OutlookMail.getInspector().

Example code:
Outlook outlook = new Outlook();
OutlookMail mail = new OutlookMail(outlook);

// Get the mail signature:
mail.getInspector();
String mailSignature = mail.getHTMLBody();

System.out.println(mailSignature);

outlook.dispose();


Powered by JavaDocPlus