com.moyosoft.connector.ms.outlook.mail
Class OutlookMail

java.lang.Object
  |
  +--com.moyosoft.connector.ms.outlook.item.OutlookItem
        |
        +--com.moyosoft.connector.ms.outlook.mail.OutlookMail
All Implemented Interfaces:
IAttachmentsContainer

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.


Constructor Summary
OutlookMail(com.moyosoft.connector.com.Dispatch dispatch)
           
OutlookMail(Outlook outlookApplication)
          Creates a new mail in the default outbox folder
OutlookMail(OutlookFolder folder)
          Creates a new mail in the specified folder
 
Method Summary
 void clearConversationIndex()
           
 void close(InspectorClose saveMode)
           
 OutlookAttachment createAttachment(java.io.File pAttachmentFile, AttachmentType pType)
           
 OutlookMail forward()
           
 AttachmentsCollection getAttachments()
           
 int getAttachmentsCount()
           
 java.lang.String getBCC()
           
 java.lang.String getBillingInformation()
           
 java.lang.String getBody()
           
 BodyFormat getBodyFormat()
          The 'BodyFormat' property is only supported by Outlook 2002 or higher.
 java.lang.String getCategories()
           
 java.lang.String getCC()
           
 java.lang.String getCompanies()
           
 ConflictsCollection getConflicts()
           
 java.lang.String getConversationIndex()
           
 java.lang.String getConversationTopic()
           
 java.util.Date getDeferredDeliveryTime()
           
 DownloadState getDownloadState()
           
 java.util.Date getExpiryTime()
           
 java.util.Date getFlagDueBy()
           
 FlagIcon getFlagIcon()
           
 java.lang.String getFlagRequest()
           
 FlagStatus getFlagStatus()
           
 FormDescription getFormDescription()
           
 java.lang.String getFrom()
          Returns the address of this e-mail's originator.
 java.lang.String getHTMLBody()
           
 ImportanceType getImportance()
           
 Inspector getInspector()
           
 int getInternetCodepage()
          The 'InternetCodepage' property is only supported by Outlook 2002 or higher.
 ItemPropertiesCollection getItemProperties()
           
 RemoteStatus getMarkForDownload()
           
 java.lang.String getMessageClass()
           
 java.lang.String getMileage()
           
 Permission getPermission()
           
 PermissionService getPermissionService()
           
 java.lang.String getReceivedByEntryID()
           
 java.lang.String getReceivedByName()
           
 java.lang.String getReceivedOnBehalfOfEntryID()
           
 java.lang.String getReceivedOnBehalfOfName()
           
 java.util.Date getReceivedTime()
           
 RecipientsCollection getRecipients()
           
 java.lang.String getReminderSoundFile()
           
 java.util.Date getReminderTime()
           
 RemoteStatus getRemoteStatus()
           
 java.lang.String getReplyRecipientNames()
           
 RecipientsCollection getReplyRecipients()
           
 java.lang.String getReplyToAddress()
          Returns the Reply-To address of this message.
 OutlookMailRecipient getReplyToRecipient()
          Returns a recipient object corresponding to the Reply-To address of this message.
 OutlookFolder getSaveSentMessageFolder()
           
 AddressEntry getSender()
          Returns the originator of this message as an AddressEntry object.
 java.lang.String getSenderAddress()
          Returns the address of this e-mail's originator.
 java.lang.String getSenderEmailAddress()
          Deprecated. Use the method getSenderAddress instead
 java.lang.String getSenderEmailType()
          The 'SenderEmailType' property is only supported by Outlook 2003 or higher.
 java.lang.String getSenderName()
           
 Account getSendUsingAccount()
          Returns the account used when sending this message.
 SensitivityType getSensitivity()
           
 java.util.Date getSentOn()
           
 java.lang.String getSentOnBehalfOfName()
           
 int getSize()
           
 java.lang.String getSubject()
           
 java.lang.String getTo()
           
 java.lang.String getTransportMessageHeaders()
          Get the Internet headers from a SMTP message.
 OutlookItemType getType()
           
 UserPropertiesCollection getUserProperties()
           
 java.lang.String getVotingOptions()
           
 java.lang.String getVotingResponse()
           
 boolean isAlternateRecipientAllowed()
           
 boolean isAutoForwarded()
           
 boolean isAutoResolvedWinner()
          The 'AutoResolvedWinner' property is only supported by Outlook 2003 or higher.
 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()
           
 OutlookMail reply()
           
 OutlookMail replyAll()
           
 void send()
           
 void setAlternateRecipientAllowed(boolean value)
           
 void setAutoForwarded(boolean value)
           
 void setBCC(java.lang.String value)
           
 void setBillingInformation(java.lang.String value)
           
 void setBody(java.lang.String value)
           
 void setBodyFormat(BodyFormat value)
          The 'BodyFormat' property is only supported by Outlook 2002 or higher.
 void setCategories(java.lang.String value)
           
 void setCC(java.lang.String value)
           
 void setCompanies(java.lang.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(java.lang.String value)
           
 void setFlagStatus(FlagStatus value)
           
 void setHasCoverSheet(boolean value)
           
 void setHTMLBody(java.lang.String value)
           
 void setImportance(ImportanceType value)
           
 void setInternetCodepage(int value)
          The 'InternetCodepage' property is only supported by Outlook 2002 or higher.
 void setIsIPFax(boolean value)
           
 void setMarkForDownload(RemoteStatus value)
           
 void setMessageClass(java.lang.String value)
           
 void setMileage(java.lang.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(java.lang.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.
 void setSensitivity(SensitivityType value)
           
 void setSentOnBehalfOfName(java.lang.String value)
           
 void setSubject(java.lang.String value)
           
 void setTo(java.lang.String value)
           
 void setUnRead(boolean value)
           
 void setVotingOptions(java.lang.String value)
           
 void setVotingResponse(java.lang.String value)
           
 void showCategoriesDialog()
           
 
Methods inherited from class com.moyosoft.connector.ms.outlook.item.OutlookItem
copy, create, delete, deleteMapiProperty, deleteMapiProperty, display, display, dispose, equals, getCreationTime, getDispatch, getEntryId, getItemId, getLastModificationTime, getLinks, getMapiProperty, getMapiProperty, getParentFolder, getPropertyAccessor, move, printOut, save, saveAs, saveAs, saveAs, saveAs, setMapiProperty, setMapiProperty
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutlookMail

public OutlookMail(OutlookFolder folder)
            throws com.moyosoft.connector.com.ComponentObjectModelException
Creates a new mail in the specified folder

Parameters:
folder - the folder where the new mail item will be created
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if a COM error occurs.

OutlookMail

public OutlookMail(Outlook outlookApplication)
            throws com.moyosoft.connector.com.ComponentObjectModelException
Creates a new mail in the default outbox folder

Parameters:
outlookApplication - the Outlook application's object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if a COM error occurs.

OutlookMail

public OutlookMail(com.moyosoft.connector.com.Dispatch dispatch)
Method Detail

getType

public OutlookItemType getType()
Specified by:
getType in class OutlookItem

getTransportMessageHeaders

public java.lang.String getTransportMessageHeaders()
                                            throws com.moyosoft.connector.com.ComponentObjectModelException
Get the Internet headers from a SMTP message. This method is only available in the Professional edition of Java Outlook Connector.

Returns:
message headers as a string
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any error occurs

getAttachments

public AttachmentsCollection getAttachments()
Specified by:
getAttachments in interface IAttachmentsContainer

createAttachment

public OutlookAttachment createAttachment(java.io.File pAttachmentFile,
                                          AttachmentType pType)
Specified by:
createAttachment in interface IAttachmentsContainer

getAttachmentsCount

public int getAttachmentsCount()
Specified by:
getAttachmentsCount in interface IAttachmentsContainer

getBillingInformation

public java.lang.String getBillingInformation()

setBillingInformation

public void setBillingInformation(java.lang.String value)

getBody

public java.lang.String getBody()

setBody

public void setBody(java.lang.String value)

getCategories

public java.lang.String getCategories()

setCategories

public void setCategories(java.lang.String value)

getCompanies

public java.lang.String getCompanies()

setCompanies

public void setCompanies(java.lang.String value)

getConversationIndex

public java.lang.String getConversationIndex()

getConversationTopic

public java.lang.String getConversationTopic()

getFormDescription

public FormDescription getFormDescription()

getInspector

public Inspector getInspector()

getImportance

public ImportanceType getImportance()

setImportance

public void setImportance(ImportanceType value)

getMessageClass

public java.lang.String getMessageClass()

setMessageClass

public void setMessageClass(java.lang.String value)

getMileage

public java.lang.String getMileage()

setMileage

public void setMileage(java.lang.String value)

isNoAging

public boolean isNoAging()

setNoAging

public void setNoAging(boolean value)

isSaved

public boolean isSaved()

getSensitivity

public SensitivityType getSensitivity()

setSensitivity

public void setSensitivity(SensitivityType value)

getSize

public int getSize()

getSubject

public java.lang.String getSubject()

setSubject

public void setSubject(java.lang.String value)

isUnRead

public boolean isUnRead()

setUnRead

public void setUnRead(boolean value)

getUserProperties

public UserPropertiesCollection getUserProperties()

close

public void close(InspectorClose saveMode)

isAlternateRecipientAllowed

public boolean isAlternateRecipientAllowed()

setAlternateRecipientAllowed

public void setAlternateRecipientAllowed(boolean value)

isAutoForwarded

public boolean isAutoForwarded()

setAutoForwarded

public void setAutoForwarded(boolean value)

getBCC

public java.lang.String getBCC()

setBCC

public void setBCC(java.lang.String value)

getCC

public java.lang.String getCC()

setCC

public void setCC(java.lang.String value)

getDeferredDeliveryTime

public java.util.Date getDeferredDeliveryTime()

setDeferredDeliveryTime

public void setDeferredDeliveryTime(java.util.Date value)

isDeleteAfterSubmit

public boolean isDeleteAfterSubmit()

setDeleteAfterSubmit

public void setDeleteAfterSubmit(boolean value)

getExpiryTime

public java.util.Date getExpiryTime()

setExpiryTime

public void setExpiryTime(java.util.Date value)

getFlagDueBy

public java.util.Date getFlagDueBy()

setFlagDueBy

public void setFlagDueBy(java.util.Date value)

getFlagRequest

public java.lang.String getFlagRequest()

setFlagRequest

public void setFlagRequest(java.lang.String value)

getFlagStatus

public FlagStatus getFlagStatus()

setFlagStatus

public void setFlagStatus(FlagStatus value)

getHTMLBody

public java.lang.String getHTMLBody()

setHTMLBody

public void setHTMLBody(java.lang.String value)

isOriginatorDeliveryReportRequested

public boolean isOriginatorDeliveryReportRequested()

setOriginatorDeliveryReportRequested

public void setOriginatorDeliveryReportRequested(boolean value)

isReadReceiptRequested

public boolean isReadReceiptRequested()

setReadReceiptRequested

public void setReadReceiptRequested(boolean value)

getReceivedByEntryID

public java.lang.String getReceivedByEntryID()

getReceivedByName

public java.lang.String getReceivedByName()

getReceivedOnBehalfOfEntryID

public java.lang.String getReceivedOnBehalfOfEntryID()

getReceivedOnBehalfOfName

public java.lang.String getReceivedOnBehalfOfName()

getReceivedTime

public java.util.Date getReceivedTime()

isRecipientReassignmentProhibited

public boolean isRecipientReassignmentProhibited()

setRecipientReassignmentProhibited

public void setRecipientReassignmentProhibited(boolean value)

getRecipients

public RecipientsCollection getRecipients()

isReminderOverrideDefault

public boolean isReminderOverrideDefault()

setReminderOverrideDefault

public void setReminderOverrideDefault(boolean value)

isReminderPlaySound

public boolean isReminderPlaySound()

setReminderPlaySound

public void setReminderPlaySound(boolean value)

isReminderSet

public boolean isReminderSet()

setReminderSet

public void setReminderSet(boolean value)

getReminderSoundFile

public java.lang.String getReminderSoundFile()

setReminderSoundFile

public void setReminderSoundFile(java.lang.String value)

getReminderTime

public java.util.Date getReminderTime()

setReminderTime

public void setReminderTime(java.util.Date value)

getRemoteStatus

public RemoteStatus getRemoteStatus()

setRemoteStatus

public void setRemoteStatus(RemoteStatus value)

getReplyRecipientNames

public java.lang.String getReplyRecipientNames()

getReplyRecipients

public RecipientsCollection getReplyRecipients()

getSaveSentMessageFolder

public OutlookFolder getSaveSentMessageFolder()

setSaveSentMessageFolder

public void setSaveSentMessageFolder(OutlookFolder folder)

getSenderName

public java.lang.String getSenderName()

isSent

public boolean isSent()

getSentOn

public java.util.Date getSentOn()

getSentOnBehalfOfName

public java.lang.String getSentOnBehalfOfName()

setSentOnBehalfOfName

public void setSentOnBehalfOfName(java.lang.String value)

isSubmitted

public boolean isSubmitted()

getTo

public java.lang.String getTo()

setTo

public void setTo(java.lang.String value)

getVotingOptions

public java.lang.String getVotingOptions()

setVotingOptions

public void setVotingOptions(java.lang.String value)

getVotingResponse

public java.lang.String getVotingResponse()

setVotingResponse

public void setVotingResponse(java.lang.String value)

clearConversationIndex

public void clearConversationIndex()

forward

public OutlookMail forward()

reply

public OutlookMail reply()

replyAll

public OutlookMail replyAll()

send

public void send()

getItemProperties

public ItemPropertiesCollection getItemProperties()

getBodyFormat

public BodyFormat getBodyFormat()
The 'BodyFormat' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.


setBodyFormat

public void setBodyFormat(BodyFormat value)
The 'BodyFormat' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.


getDownloadState

public DownloadState getDownloadState()

showCategoriesDialog

public void showCategoriesDialog()

getInternetCodepage

public int getInternetCodepage()
The 'InternetCodepage' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.


setInternetCodepage

public void setInternetCodepage(int value)
The 'InternetCodepage' property is only supported by Outlook 2002 or higher. With other versions this method will throw an ComponentObjectModelException.


getMarkForDownload

public RemoteStatus getMarkForDownload()

setMarkForDownload

public void setMarkForDownload(RemoteStatus value)

isConflict

public boolean isConflict()

isIPFax

public boolean isIPFax()

setIsIPFax

public void setIsIPFax(boolean value)

getFlagIcon

public FlagIcon getFlagIcon()

setFlagIcon

public void setFlagIcon(FlagIcon value)

isHasCoverSheet

public boolean isHasCoverSheet()

setHasCoverSheet

public void setHasCoverSheet(boolean value)

isAutoResolvedWinner

public boolean isAutoResolvedWinner()
The 'AutoResolvedWinner' property is only supported by Outlook 2003 or higher. With other versions this method will throw an ComponentObjectModelException.


getConflicts

public ConflictsCollection getConflicts()

getSenderEmailAddress

public java.lang.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.


getSenderEmailType

public java.lang.String getSenderEmailType()
The 'SenderEmailType' property is only supported by Outlook 2003 or higher. With other versions this method will throw a ComponentObjectModelException.


getFrom

public java.lang.String getFrom()
Returns the address of this e-mail's originator. Returns the same value as the method getSenderAddress.


getReplyToRecipient

public OutlookMailRecipient getReplyToRecipient()
Returns a recipient object corresponding to the Reply-To address of this message.


getReplyToAddress

public java.lang.String getReplyToAddress()
Returns the Reply-To address of this message.


getSenderAddress

public java.lang.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).


getSender

public AddressEntry getSender()
Returns the originator of this message as an AddressEntry object.


isEnableSharedAttachments

public boolean isEnableSharedAttachments()

setEnableSharedAttachments

public void setEnableSharedAttachments(boolean value)

getPermission

public Permission getPermission()

setPermission

public void setPermission(Permission value)

getPermissionService

public PermissionService getPermissionService()

setPermissionService

public void setPermissionService(PermissionService value)

getSendUsingAccount

public Account 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.


setSendUsingAccount

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