Message¶
The Message type represents an email message in a PST file.
Identification¶
ID¶
Returns the message's node ID.
Content¶
Subject¶
Returns the message subject.
NormalizedSubject¶
Returns the normalized subject (without "Re:", "Fwd:" prefixes).
Body¶
Returns the plain text body.
HTMLBody¶
Returns the HTML body.
RTFBody¶
Returns the compressed RTF body (raw bytes).
RTFBodyDecompressed¶
Returns the decompressed RTF body as a string. Uses the LZFu decompression algorithm per MS-OXRTFCP.
MessageClass¶
Returns the message class (e.g., "IPM.Note").
Sender Information¶
SenderName¶
Returns the sender's display name.
SenderEmail¶
Returns the sender's email address.
SentRepresentingName¶
Returns the "sent on behalf of" display name.
SentRepresentingEmail¶
Returns the "sent on behalf of" email address.
Recipients¶
DisplayTo¶
Returns the To recipients as a formatted string.
DisplayCc¶
Returns the Cc recipients as a formatted string.
DisplayBcc¶
Returns the Bcc recipients as a formatted string.
Recipients¶
Returns an iterator over individual recipients.
RecipientCount¶
Returns the number of recipients.
Timestamps¶
DeliveryTime¶
Returns when the message was delivered.
SubmitTime¶
Returns when the message was submitted.
CreationTime¶
Returns when the message was created.
LastModificationTime¶
Returns when the message was last modified.
Attributes¶
MessageSize¶
Returns the message size in bytes.
Importance¶
Returns the importance level (0=low, 1=normal, 2=high).
Priority¶
Returns the priority (0=non-urgent, 1=normal, 2=urgent).
Sensitivity¶
Returns the sensitivity (0=normal, 1=personal, 2=private, 3=confidential).
HasAttachments¶
Returns true if the message has attachments.
Internet Headers¶
InternetMessageID¶
Returns the RFC 822 Message-ID.
ConversationTopic¶
Returns the conversation topic.
ConversationIndex¶
Returns the conversation index (binary).
Attachments¶
Attachments¶
Returns an iterator over attachments.
AttachmentCount¶
Returns the number of attachments.
Advanced Access¶
PropertyBag¶
Returns the message's property bag.
AttachmentTable¶
Returns the attachment table.
RecipientTable¶
Returns the recipient table.
Example¶
func printMessage(msg *outlookpst.Message) {
subject, _ := msg.Subject()
sender, _ := msg.SenderName()
senderEmail, _ := msg.SenderEmail()
deliveryTime, _ := msg.DeliveryTime()
body, _ := msg.Body()
fmt.Printf("Subject: %s\n", subject)
fmt.Printf("From: %s <%s>\n", sender, senderEmail)
fmt.Printf("Date: %s\n", deliveryTime.Format(time.RFC1123))
fmt.Printf("\n%s\n", body)
// Print attachments
for att, _ := range msg.Attachments() {
filename, _ := att.Filename()
size, _ := att.Size()
fmt.Printf("Attachment: %s (%d bytes)\n", filename, size)
}
}