LazyMAPI

The TMAPIMessage - Delphi IMessage wrapper object.

unit: MAPIMessage.pas
file path: ..\Library\Helpers
version: 2014.хх
uses
Classes, ActiveX, Windows, Contnrs, SHDocVw, Variants, SysUtils, ExtendedMAPI, Types, MAPIUtils,
IMIEMTypes, MAPIProperty, MAPITable, MAPIAddrEntry;

 

Unit: MAPIPropFields.pas
Type: Class
Inherited from: TMAPIProperty
 
 
 TMAPIMessage = class(TMAPIProperty)
  protected
    ...
  public
    constructor Create(const oMessage: IMessage); reintroduce;
    destructor Destroy; override;
    property MAPISession;
    property AlternateRecipientAllowed: Boolean read GetAlternateRecipientAllowed write SetAlternateRecipientAllowed;
    property AutoForwarded: Boolean read GetAutoForwarded write SetAutoForwarded;
    property AutoForwardComment: String read GetAutoForwardComment write SetAutoForwardComment;
    property BillingInformation: String read GetBillingInformation write SetBillingInformation;
    property Body: TMAPIMessageBody read GetBody;
    property BodyFormat: TBodyType read GetBodyFormat;
    property BodyPlain: String read GetBodyPlain write SetBodyPlain;
    property BodyRTF: string read GetRTFBody write SetRTFBody;
    property BodyHTML: String read GetHTMLBody write SetHTMLBody;
    property Categories: TStrings read GetCategories;
    property Companies: TStrings read GetCompanies;
    property Contacts: TStrings read GetContacts;
    property ConversationID: TBytes read GetConversationID;
    property ConversationIndex: TBytes read GetConversationIndex;
    property ConversationTopic: String read GetConversationTopic;
    property CreationTime;
    property DeferredDeliveryTime: TDateTime read GetDeferredDeliveryTime write SetDeferredDeliveryTime;
    property DeleteAfterSubmit: Boolean read GetDeleteAfterSubmit write SetDeleteAfterSubmit;
    property EntryID;
    property ExpiryTime: TDateTime read GetExpiryTime write SetExpiryTime;
    property FlagDueBy: TDateTime read GetFlagDueBy write SetFlagDueBy;
    property FlagIcon: TOlFlagIcon read GetFlagIcon write SetFlagIcon;
    property FlagRequest: String read GetFlagRequest write SetFlagRequest;
    property FlagStatus: TFollowUpStatus read GetFlagStatus write SetFlagStatus;
    property Importance: TMsgImportance read GetImportance write SetImportance;
    property InternetCodepage: Cardinal read GetInternetCodepage write SetInternetCodepage;
    property IsMarkedAsTask: Boolean read GetIsMarkedAsTask;
    property LastModificationTime;
    property MessageClass: string read GetMessageClass write SetMessageClass;
    property Mileage: string read GetMileage write SetMileage;
    property NoAging: Boolean read GetNoAging write SetNoAging;
    property OriginatorDeliveryReportRequested: Boolean read GetOriginatorDeliveryReportRequested write SetOriginatorDeliveryReportRequested;
    property ReadReceiptRequested: Boolean read GetReadReceiptRequested write SetReadReceiptRequested;
    property ReceivedByEntryID: TBytes read GetReceivedByEntryID;
    property ReceivedByName: string read GetReceivedByName;
    property ReceivedOnBehalfOfEntryID: TBytes read GetReceivedOnBehalfOfEntryID;
    property ReceivedOnBehalfOfName: string read GetReceivedOnBehalfOfName;
    property ReceivedTime: TDateTime read GetReceivedTime;
    property RecipientReassignmentProhibited: Boolean read GetRecipientReassignmentProhibited write SetRecipientReassignmentProhibited;
    property Recipients: TMAPIRecipients Read GetRecipients;
    property ReminderOverrideDefault: Boolean read GetReminderOverrideDefault write SetReminderOverrideDefault;
    property ReminderPlaySound: Boolean read GetReminderPlaySound write SetReminderPlaySound;
    property ReminderSet: Boolean read GetReminderSet write SetReminderSet;
    property ReminderSoundFile: string read GetReminderSoundFile write SetReminderSoundFile;
    property ReminderTime: TDateTime read GetReminderTime write SetReminderTime;
    property RemoteStatus: TRemoteStatus read GetRemoteStatus write SetRemoteStatus;
    property ReplyRecipientNames: string read GetReplyRecipientNames;
    property ReplyRecipients: TMAPIRecipients read GetReplyRecipients;
    property SenderName: String Read GetSenderName;
    property SenderEmailAddress: String Read GetSenderEmailAddress;
    property SenderEmailType: String Read GetSenderAddressType;
    property Sensitivity: TMsgSensitivity read GetSensitivity write SetSensitivity;
    property SentOn: TDateTime read GetSentOn;
    property SentOnBehalfOfName: string read GetSentOnBehalfOfName write SetSentOnBehalfOfName;
    property SentOnBehalfOfEmailAddress: string read GetSentOnBehalfOfEmailAddress write SetSentOnBehalfOfEmailAddress;
    property SentOnBehalfOfEmailType: string read GetSentOnBehalfOfAddressType write SetSentOnBehalfOfAddressType;
    property SentOnBehalfOfEntryId: TBytes read GetSentOnBehalfOfEntryId write SetSentOnBehalfOfEntryId;
    property Size: Cardinal Read GetMsgSize;
    property Subject: String Read GetSubject Write SetSubject;
    property TaskCompletedDate: TDateTime read GetTaskCompletedDate write SetTaskCompletedDate;
    property TaskDueDate: TDateTime read GetTaskDueDate write SetTaskDueDate;
    property TaskStartDate: TDateTime read GetTaskStartDate write SetTaskStartDate;
    property TaskSubject: string read GetTaskSubject write SetTaskSubject;
    property ToDoTaskOrdinal: TDateTime read GetToDoTaskOrdinal write SetToDoTaskOrdinal;
    property InternetAccountName: String read GetInternetAccountName write SetInternetAccountName;
    property InternetAccountStamp: String read GetInternetAccountStamp write SetInternetAccountStamp;
    property ToNames: String index rtTo read GetRecipientsNames;
    property CcNames: String index rtCc read GetRecipientsNames;
    property BCcNames: String index rtBCc read GetRecipientsNames;
  end;

Constructors

Name Description
constructor Create(const oMessage: IMessage); reintroduce; Creates and initializes object instance from IMessage

Properties

Name Access Type Description
AlternateRecipientAllowed RW Boolean Boolean value that indicates whether the mail message can be forwarded. (PR_ALTERNATE_RECIPIENT_ALLOWED)
AutoForwardComment RW String  Contains a comment added by the auto-forwarding agent. (PR_AUTO_FORWARD_COMMENT)
AutoForwarded RW Boolean A Boolean value that returns True if the item was automatically forwarded. (PR_AUTO_FORWARDED)
BCcNames RO String Contains an ASCII list of the display names of any blind carbon copy (BCC) message recipients, separated by semicolons (;). (PR_DISPLAY_BCC)
BillingInformation RW String Returns or sets a String representing the billing information (PidLidBilling)
Body RO TMAPIMessageBody Returns a TMAPIMessageBody object that represents the body
BodyFormat RO TBodyType Specifies the format of the "best" body
BodyHTML RW String Contains the message body text in HTML format  (PR_HTML)
BodyPlain RW String Contains the message body text in plain (clear text) format  (PR_BODY)
BodyRTF RW String Returns or sets a string that represents the body of the Microsoft Outlook item in Rich Text Format. (PR_RTF_COMPRESSED)
Categories RO TStrings Returns or sets a String representing the categories assigned to the message item (PidNameKeywords)
CcNames RO String Contains an ASCII list of the display names of any carbon copy (CC) message recipients, separated by semicolons (;). (PR_DISPLAY_CC)
Companies RO TStrings Returns or sets a String representing the names of the companies associated with the message item.  (PidLidCompanies)
Contacts RO TStrings Contains the names of contacts associated with the item.  (PidLidContacts)
ConversationID RO TBytes Contains a computed value derived from other conversation-related properties. Associates items with a conversation (PR_CONVERSATION_ID)
ConversationIndex RO TBytes Indicates the relative position of this message within a conversation thread (PR_CONVERSATION_INDEX)
ConversationTopic RO String Representing the topic of the conversation thread of the message item  (PR_CONVERSATION_TOPIC)
CreationTime RO TDateTime Returns a DateTime indicating the creation time for the message item. (PR_CREATION_TIME)
DeferredDeliveryTime RW TDateTime Returns or sets a DateTime indicating the date and time the mail message is to be delivered. (PR_DEFERRED_DELIVERY_TIME)
DeleteAfterSubmit RW Boolean Contains TRUE if a client application wants MAPI to delete the associated message after submission. (PR_DELETE_AFTER_SUBMIT)
EntryID RO TBytes Returns a TBytes representing the unique Entry ID of the object. Contains a MAPI entry identifier (PR_ENTRYID)
ExpiryTime RW TDateTime Contains the date and time when the messaging system can invalidate the content of a message. (PR_EXPIRY_TIME)
FlagDueBy RW TDateTime The time that a reply to an original message was sent out. Contains the deadline on a message. (PR_REPLY_TIME)
FlagIcon RW TOlFlagIcon Contains the color associated with a flagged item in Microsoft Office Outlook (PR_FOLLOWUP_ICON)
FlagRequest RW String Returns or sets a String indicating the requested action for an e-mail message. This is a free-form text field. This property is only valid if the FlagStatus property is also set for the message. (PidLidFlagRequest)
FlagStatus RW TFollowUpStatus Contains the Microsoft Office Outlook follow-up flags for the message. (PR_FLAG_STATUS)
Importance RW TMsgImportance Contains a value that indicates the message sender's opinion of the importance of a message. (PR_IMPORTANCE)
InternetAccountName RW string Specifies the user-visible e-mail account name through which the e-mail message is sent.  (PidLidInternetAccountName)
InternetAccountStamp RW string Specifies the e-mail account ID through which the e-mail message is sent.  (PidLidInternetAccountStamp)
InternetCodepage RW Cardinal Indicates the code page used for PR_BODY or PR_BODY_HTML  properties.
IsMarkedAsTask RW Boolean Returns a Boolean value that indicates whether the Mail is marked as a task.
LastModificationTime RO TDateTime Returns a Date specifying the date and time that the Outlook item was last modified.  (PR_LAST_MODIFICATION_TIME)
MAPISession RW IMAPISession Gives access to interface used to manage objects associated with a MAPI session.
MessageClass RW string Returns or sets a String representing the message class for the message item. (PR_MESSAGE_CLASS)
Mileage RW string Returns or sets a String representing the mileage for an item. (PidLidMileage)
NoAging RW Boolean Specifies a value of TRUE if the item will not be automatically archived. (PidLidAgingDontAgeMe)
OriginatorDeliveryReportRequested RW Boolean Returns or sets a Boolean value that determines whether the originator of the meeting item or mail message will receive a delivery report. (PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED)
ReadReceiptRequested RW Boolean Returns a Boolean value that indicates True if a read receipt has been requested by the sender. (PR_READ_RECEIPT_REQUESTED)
ReceivedByEntryID RO TBytes Representing the EntryID for the true recipient as set by the transport provider delivering the mail message  (PR_RECEIVED_BY_ENTRYID)
ReceivedByName RO string Returns a String representing the display name of the true recipient for the mail message (PR_RECEIVED_BY_NAME)
ReceivedOnBehalfOfEntryID RO TBytes Representing the EntryID of the user delegated to represent the recipient for the mail message.  (PR_RCVD_REPRESENTING_ENTRYID)
ReceivedOnBehalfOfName RO string Representing the display name of the user delegated to represent the recipient for the mail message (PR_RCVD_REPRESENTING_NAME)
ReceivedTime RO TDateTime Returns a DateTime indicating the date and time at which the item was received  (PR_MESSAGE_DELIVERY_TIME)
RecipientReassignmentProhibited RW Boolean Returns/Sets a Boolean that indicates True if the recipient cannot forward the mail message. (PR_RECIPIENT_REASSIGNMENT_PROHIBITED)
Recipients RO TMAPIRecipients Returns a TMAPIAddressEntries that represents all the recipients for the message item.
ReminderOverrideDefault RW Boolean Returns or sets a Boolean value that is True if the reminder overrides the default reminder behavior for the item.  (PidLidReminderOverride)
ReminderPlaySound RW Boolean Returns or sets a Boolean value that is True if the reminder should play a sound when it occurs for this item. (PidLidReminderPlaySound)
ReminderSet RW Boolean Returns or sets a Boolean value that is True if a reminder has been set for this item  (PidLidReminderSet)
ReminderSoundFile RW string Returns or sets a String indicating the path and file name of the sound file to play when the reminder occurs for the message item (PidLidReminderFileParameter)
ReminderTime RW TDateTime Returns or sets a DateTime indicating the date and time at which the reminder should occur for the specified item (PidLidReminderTime)
RemoteStatus RW TRemoteStatus Returns or sets an TRemoteStatus constant specifying the remote status of the mail message.  (PidLidRemoteStatus)
ReplyRecipientNames RO string Returns a semicolon-delimited String list of reply recipients for the mail message.  (PR_REPLY_RECIPIENT_NAMES)
ReplyRecipients RO TMAPIRecipients Returns a TMAPIAddressEntries collection that represents all the reply recipient objects for the message  item.
SenderEmailAddress RO string Returns a String that represents the e-mail address of the sender of the message item  (PR_SENDER_EMAIL_ADDRESS)
SenderEmailType RO string Returns a String that represents the type of entry for the e-mail address of the sender of the message item, such as 'SMTP' for Internet address, 'EX' for a Microsoft Exchange server address, etc.  (PR_SENDER_ADDRTYPE)
SenderName RO string Returns a String indicating the display name of the sender for the message item. (PR_SENDER_NAME)
Sensitivity RW TMsgSensitivity Returns or sets a constant in the TMsgSensitivity enumeration indicating the sensitivity for the message item. (PR_SENSITIVITY)
SentOn RO TDateTime Returns a DateTime indicating the date and time on which the message item was sent. (PR_CLIENT_SUBMIT_TIME)
SentOnBehalfOfEmailAddress RW string Contains the e-mail address for the messaging user who is represented by the sender. (PR_SENT_REPRESENTING_EMAIL_ADDRESS)
SentOnBehalfOfEmailType RW string Contains the address type for the messaging user who is represented by the sender.  (PR_SENT_REPRESENTING_ADDRTYPE)
SentOnBehalfOfEntryId RW TBytes Contains the entry identifier for the messaging user represented by the sender. (PR_SENT_REPRESENTING_ENTRYID)
SentOnBehalfOfName RW string Returns a String indicating the display name for the intended sender of the mail message  (PR_SENT_REPRESENTING_NAME)
Size RO Cardinal Contains the sum, in bytes, of the sizes of all properties on a message object. (PR_MESSAGE_SIZE)
Subject RW string Contains the full subject of a message.  (PR_SUBJECT)
TaskCompletedDate RW TDateTime Returns or sets a Date value that represents the completion date of the task for this Mail item. (PidLidTaskDateCompleted)
TaskDueDate RW TDateTime Returns or sets a Date value that represents the due date of the task for this Mail item  (PidLidTaskDueDate)
TaskStartDate RW TDateTime The date when the user expects to begin the task (PidLidTaskStartDate)
TaskSubject RW string Contains user-specifiable text to identify this message object in a consolidated to-do list.  (PidLidToDoTitle)
ToDoTaskOrdinal RW TDateTime Returns or sets a DateTime value that represents the ordinal value of the task for the MailItem  (PidLidToDoOrdinalDate)
ToNames RO string Contains a list of the display names of the primary (To) message recipients, separated by semicolons (;).  (PR_DISPLAY_TO)

Top


TMAPIMessageBody - Delphi object that represents IMessage body.

unit: MAPIMessage.pas
file path: ..\Library\Helpers
version: 2014.хх

TMAPIMessageBody = class(TObject)
  private
    ...
  public
    constructor Create(const oMessage: IMessage);
    property Plain: String read GetPlainBody write SetPlainBody;
    property RTF: String read GetRTFBody write SetRTFBody;
    property HTML: String read GetHTMLBody write SetHTMLBody;
    property Codepage: Cardinal Read GetInternetCodepage write SetInternetCodepage;
    property BestBodyType: TBodyType read GetBestBodyType;
    function SaveToStream(Stream: TStream; BodyType: TBodyType): Int64;
    function LoadFromStream(Stream: TStream; BodyType: TBodyType): Boolean;
    function ShowHTML(const WebBrowser: TWebBrowser): Boolean;
  end;

Constructors

Name Description
constructor Create(const oMessage: IMessage); reintroduce; Creates and initializes object instance from IMessage

Properties

Name Access Type Description
Plain RW String Returns or Sets the message body (as plain plain text) (PR_BODY)
RTF RW String Returns or Sets the Rich Text Format (RTF) version of the message text, usually in compressed form.
This property contains the same message text as the Plain property but in RTF.  (PR_RTF_COMPRESSED). RTF is always ASCII.
HTML RW String Returns or Sets the message body text in HTML format (PR_HTML)
Codepage RW Cardinal Returns or Set the code page (PR_INTERNET_CPID) used for message body. Indicates the code page used for PR_BODY or PR_BODY_HTML properties.
BestBodyType RO TBodyType Contains a value that indicates the message best body format as plain/RTF/HTML

Methods

Name Description
SaveToStream Save (copy) the message body to TStream. Returns the steam size.

function SaveToStream(Stream: TStream; BodyType: TMsgBodyType): Int64;
LoadFromStream Sets the message body from TStream.

function LoadFromStream(Stream: TStream; BodyType: TMsgBodyType): Boolean;
ShowHTML Displays the body of the message in TWebBrowser.

function ShowHTML(const WebBrowser: TWebBrowser): Boolean;

Top


Copyright 2021 IMIBO
Privacy Statement