Showing preview only (1,682K chars total). Download the full file or copy to clipboard to get everything.
Repository: Sicos1977/MsgKit
Branch: master
Commit: 30f8c1957a6f
Files: 135
Total size: 1.6 MB
Directory structure:
gitextract_xbt61gzj/
├── .gitattributes
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── MsgKit/
│ ├── Address.cs
│ ├── Appointment.cs
│ ├── Attachments.cs
│ ├── Contact.cs
│ ├── ContactAssistant.cs
│ ├── ContactBusiness.cs
│ ├── ContactCommon.cs
│ ├── ContactCompanyMain.cs
│ ├── ContactHome.cs
│ ├── ContactOther.cs
│ ├── ContactWork.cs
│ ├── ContactYomi.cs
│ ├── Converter.cs
│ ├── Email.cs
│ ├── Enums/
│ │ ├── AddressBookEntryIdType.cs
│ │ ├── AddressType.cs
│ │ ├── AppointmentState.cs
│ │ ├── AttachmentFlags.cs
│ │ ├── AttachmentType.cs
│ │ ├── MapiAccess.cs
│ │ ├── MapiObjectType.cs
│ │ ├── MeetingType.cs
│ │ ├── MessageClass.cs
│ │ ├── MessageEditorFormat.cs
│ │ ├── MessageFlags.cs
│ │ ├── MessageFormat.cs
│ │ ├── MessageIconIndex.cs
│ │ ├── MessageImportance.cs
│ │ ├── MessagePriority.cs
│ │ ├── PostalAddressId.cs
│ │ ├── PropertyFlags.cs
│ │ ├── PropertyKind.cs
│ │ ├── PropertyType.cs
│ │ ├── RecipientFlags.cs
│ │ ├── RecipientRowAddressType.cs
│ │ ├── RecipientRowDisplayType.cs
│ │ ├── RecipientType.cs
│ │ ├── RecurrencePatternCalendarType.cs
│ │ ├── RecurrencePatternFirstDOWDay.cs
│ │ ├── RecurrencePatternFrequency.cs
│ │ ├── RecurrencePatternPatternType.cs
│ │ ├── RecurrencePatternRecurrenceRangeType.cs
│ │ ├── StoreSupportMask.cs
│ │ ├── TaskAcceptanceState.cs
│ │ ├── TaskHistory.cs
│ │ ├── TaskMode.cs
│ │ ├── TaskMultipleRecipients .cs
│ │ ├── TaskOwnership.cs
│ │ ├── TaskState.cs
│ │ └── TaskStatus.cs
│ ├── Exceptions/
│ │ ├── MKAttachment.cs
│ │ ├── MKAttachmentExists.cs
│ │ ├── MKInvalidProperty.cs
│ │ ├── MKMessageSaved.cs
│ │ └── MKPropertyNotFound.cs
│ ├── Helpers/
│ │ ├── Conversion.cs
│ │ ├── Crc32Calculator.cs
│ │ ├── EmailAddress.cs
│ │ ├── Exception.cs
│ │ ├── ExtensionMethods.cs
│ │ ├── FileManager.cs
│ │ ├── Mapi.cs
│ │ ├── MimeType.cs
│ │ ├── Stream.cs
│ │ └── Strings.cs
│ ├── Message.cs
│ ├── Mime/
│ │ ├── Decode/
│ │ │ ├── Base64.cs
│ │ │ ├── EncodedWord.cs
│ │ │ ├── EncodingFinder.cs
│ │ │ ├── QuotedPrintable.cs
│ │ │ ├── Rfc2231Decoder.cs
│ │ │ ├── Rfc2822DateTime.cs
│ │ │ ├── SizeParser.cs
│ │ │ └── Utility.cs
│ │ └── Header/
│ │ ├── ContentTransferEncoding.cs
│ │ ├── HeaderExtractor.cs
│ │ ├── HeaderFieldParser.cs
│ │ ├── MessageHeader.cs
│ │ ├── Received.cs
│ │ └── RfcMailAddress.cs
│ ├── MsgKit.csproj
│ ├── MsgKit.snk
│ ├── MsgKit.xml
│ ├── NamedPropertyMapping.cs
│ ├── NamedPropertyTags.cs
│ ├── PropertyTags.cs
│ ├── Receiving.cs
│ ├── ReceivingRepresenting.cs
│ ├── Recipient.cs
│ ├── Representing.cs
│ ├── Rtf/
│ │ ├── Compressor.cs
│ │ └── Encapsulator.cs
│ ├── Sender.cs
│ ├── Streams/
│ │ ├── AttachmentProperties.cs
│ │ ├── EmbeddedMessageProperties.cs
│ │ ├── EntryStream.cs
│ │ ├── GuidStream.cs
│ │ ├── NamedProperties.cs
│ │ ├── RecipientProperties.cs
│ │ ├── StringStream.cs
│ │ └── TopLevelProperties.cs
│ ├── Structures/
│ │ ├── AddressBookEntryId.cs
│ │ ├── CLSID.cs
│ │ ├── NamedProperty.cs
│ │ ├── OneOffEntryId.cs
│ │ ├── Properties.cs
│ │ ├── Property.cs
│ │ ├── RecipientRow.cs
│ │ ├── RecurrencePattern.cs
│ │ ├── ReportTag.cs
│ │ └── UnsendableRecipients.cs
│ ├── Task.cs
│ ├── ThreadIndex.cs
│ ├── TranslateTags.cs
│ ├── app.config
│ └── packages.config
├── MsgKit.sln
├── MsgKit.sln.DotSettings
├── MsgKitTestTool/
│ ├── EmailForm.Designer.cs
│ ├── EmailForm.cs
│ ├── EmailForm.resx
│ ├── MsgKitTestTool.csproj
│ ├── Program.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Tests.cs
│ ├── app.config
│ └── packages.config
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [Sicos1977]
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
.vs/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml
# NuGet Packages Directory
packages/*
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
.vs/MsgKit/v15/sqlite3/storage.ide
/.vs/MsgKit/v15/Server/sqlite3/storage.ide-wal
/.vs/MsgKit/v15/Server/sqlite3/storage.ide-shm
/.vs/MsgKit/v15/Server/sqlite3/storage.ide
/.vs/MsgKit/v15/Server/sqlite3/db.lock
/.vs/MsgKit/v15/sqlite3/db.lock
/.vs/MsgKit/v15/sqlite3/storage.ide-shm
/.vs/VSWorkspaceState.json
/.vs/slnx.sqlite
/.vs/ProjectSettings.json
/.vs/MsgKit/v15/sqlite3/storage.ide-wal
/.vs/MsgKit/v16/Server/sqlite3/db.lock
================================================
FILE: MsgKit/Address.cs
================================================
//
// Address.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using MsgKit.Enums;
using MsgKit.Structures;
namespace MsgKit;
/// <summary>
/// A base class for <see cref="Sender"/>, <see cref="Recipient"/>, <see cref="Receiving"/>
/// and <see cref="Representing"/>
/// </summary>
public class Address
{
#region Fields
/// <summary>
/// The messaging user's e-mail address type
/// </summary>
private AddressType _addressType;
#endregion
#region Properties
/// <summary>
/// The E-mail address
/// </summary>
public string Email { get; internal set; }
/// <summary>
/// The displayname for the <see cref="Email"/>
/// </summary>
public string DisplayName { get; internal set; }
/// <summary>
/// The original displayname for the <see cref="Email"/>
/// </summary>
public string OriginalDisplayName => AddressType == AddressType.Smtp ? Email : DisplayName;
/// <summary>
/// Returns the messaging user's e-mail address type. Use <see cref="AddressTypeString"/>
/// when this property returns <see cref="Enums.AddressType.Unknown"/>
/// </summary>
public AddressType AddressType
{
get => _addressType;
internal set
{
_addressType = value;
switch (value)
{
case AddressType.Unknown:
AddressTypeString = string.Empty;
break;
case AddressType.Ex:
AddressTypeString = "EX";
break;
case AddressType.Smtp:
AddressTypeString = "SMTP";
break;
case AddressType.Fax:
AddressTypeString = "FAX";
break;
case AddressType.Mhs:
AddressTypeString = "MHS";
break;
case AddressType.Profs:
AddressTypeString = "PROFS";
break;
case AddressType.X400:
AddressTypeString = "X400";
break;
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
}
}
/// <summary>
/// Returns the <see cref="Enums.AddressType"/> as a string
/// </summary>
public string AddressTypeString { get; private set; }
/// <summary>
/// <see cref="OneOffEntryId"/>
/// </summary>
internal OneOffEntryId OneOffEntryId => new(Email, DisplayName, AddressType);
#endregion
#region Constructor
/// <summary>
/// Creates this object and sets all it's needed properties
/// </summary>
/// <param name="email">The full E-mail address</param>
/// <param name="displayName">The displayname for the <paramref name="email" /></param>
/// <param name="addressType">The <see cref="AddressType" /></param>
public Address(string email,
string displayName,
AddressType addressType = AddressType.Smtp)
{
Email = email ?? string.Empty;
DisplayName = string.IsNullOrWhiteSpace(displayName) ? email : displayName;
AddressType = addressType;
}
#endregion
}
================================================
FILE: MsgKit/Appointment.cs
================================================
//
// Appointment.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.IO;
using MsgKit.Enums;
// ReSharper disable UnusedMember.Global
namespace MsgKit;
/// <summary>
/// A class to make an appointment
/// </summary>
/// <remarks>
/// Inherits from <see cref="Email"/>>, because it has quite a few of the same fields
/// </remarks>
public class Appointment : Email
{
#region Properties
/// <summary>
/// Holds the location for the Appointment
/// </summary>
public string Location { get; set; }
/// <summary>
/// This property specifies whether the event is an all-day event, as
/// specified by the user. A value of <c>true</c> indicates that the event is an all-day
/// event, in which case the start time and end time must be midnight so that the
/// duration is a multiple of 24 hours and is at least 24 hours. A value of <c>false</c>
/// or the absence of this property indicates the event is not an all-day event. The
/// client or server must not infer the value as TRUE when a user happens to create an
/// event that is 24 hours, even if the event starts and ends at midnight.
/// </summary>
public bool AllDay { get; set; }
/// <summary>
/// Holds meeting information for the appointment
/// </summary>
public DateTime MeetingStart { get; set; }
/// <summary>
/// The end of the meeting
/// </summary>
public DateTime MeetingEnd { get; set; }
#endregion
#region Constructors
/// <summary>
/// Sends an appointment with sender, representing, subject, draft.
/// </summary>
/// <param name="sender"> Contains sender name and email. </param>
/// <param name="representing">Contains who this appointment is representing. </param>
/// <param name="subject"> Contains the subject for this appointment. </param>
/// <param name="draft"> Is this a draft?</param>
public Appointment(Sender sender,
Representing representing,
string subject,
bool draft = false) : base(sender, representing, subject, draft)
{
}
/// <summary>
/// Used to send without the representing structure.
/// </summary>
/// <param name="sender"></param>
/// <param name="subject"></param>
/// <param name="draft"></param>
public Appointment(Sender sender,
string subject,
bool draft = false) : base(sender, subject, draft)
{
}
#endregion
#region WriteToStorage
/// <summary>
/// Writes all the properties that are part of the <see cref="Appointment"/> object either as <see cref="OpenMcdf.Storage"/>'s
/// or <see cref="OpenMcdf.CfbStream"/>'s to the <see cref="OpenMcdf.RootStorage"/>
/// </summary>
private new void WriteToStorage()
{
Class = MessageClass.IPM_Appointment;
NamedProperties.AddProperty(NamedPropertyTags.PidLidLocation, Location);
NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentStartWhole, MeetingStart);
NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentEndWhole, MeetingEnd);
NamedProperties.AddProperty(NamedPropertyTags.PidLidMeetingType, MeetingType.mtgRequest);
NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentSubType, AllDay);
NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentStateFlags, AppointmentState.asfMeeting);
}
#endregion
#region Save
/// <summary>
/// Saves the message to the given <paramref name="stream" />
/// </summary>
/// <param name="stream"></param>
public new void Save(Stream stream)
{
WriteToStorage();
base.Save(stream);
}
/// <summary>
/// Saves the message to the given <paramref name="fileName" />
/// </summary>
/// <param name="fileName"></param>
public new void Save(string fileName)
{
WriteToStorage();
base.Save(fileName);
}
#endregion
}
================================================
FILE: MsgKit/Attachments.cs
================================================
//
// Attachments.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MsgKit.Enums;
using MsgKit.Exceptions;
using MsgKit.Helpers;
using MsgKit.Streams;
using MsgKit.Structures;
using OpenMcdf;
using Stream = System.IO.Stream;
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
namespace MsgKit;
/// <summary>
/// Contains a list of <see cref="Attachment" /> objects that are added to a <see cref="Message" />
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc842285.aspx
/// </remarks>
public class Attachments : List<Attachment>
{
#region CheckAttachmentFileName
/// <summary>
/// Checks if the <paramref name="fileName" /> already exists in this object
/// </summary>
/// <param name="fileName"></param>
/// <param name="contentId"></param>
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local
private void CheckAttachmentFileName(string fileName, string contentId)
{
var file = Path.GetFileName(fileName);
if (this.Any(
attachment => attachment.FileName.Equals(fileName, StringComparison.InvariantCultureIgnoreCase)
&& string.Equals(attachment.ContentId, contentId,
StringComparison.InvariantCultureIgnoreCase)))
throw new MKAttachmentExists($"The attachment with the name '{file}' already exists");
}
#endregion
#region WriteToStorage
/// <summary>
/// Writes the <see cref="Attachment" /> objects to the given <paramref name="rootStorage" />
/// and it will set all the needed properties
/// </summary>
/// <param name="rootStorage">The root <see cref="OpenMcdf.Storage" /></param>
/// <returns>
/// Total size of the written <see cref="Attachment"/> objects and it's <see cref="Properties"/>
/// </returns>
internal long WriteToStorage(Storage rootStorage)
{
long size = 0;
for (var index = 0; index < Count; index++)
{
var attachment = this[index];
var storage = rootStorage.CreateStorage(PropertyTags.AttachmentStoragePrefix + index.ToString("X8").ToUpper());
size += attachment.WriteProperties(storage, index);
}
return size;
}
#endregion
#region AddAttachment
/// <summary>
/// Adds an <see cref="Attachment" /> by <see cref="AttachmentType.ATTACH_BY_VALUE" /> (default)
/// </summary>
/// <param name="fileName">The file to add with its full path</param>
/// <param name="renderingPosition">Indicates how an attachment should be displayed in a rich text message</param>
/// <param name="isInline">Set to true to add the attachment inline</param>
/// <param name="contentId">The id for the inline attachment when <paramref name="isInline" /> is set to true</param>
/// <exception cref="FileNotFoundException">Raised when the <paramref name="fileName" /> could not be found</exception>
/// <exception cref="MKAttachmentExists">Raised when an attachment with the same name already exists</exception>
/// <exception cref="ArgumentNullException">
/// Raised when <paramref name="isInline" /> is set to true and
/// <paramref name="contentId" /> is null, white space or empty
/// </exception>
public void Add(string fileName,
long renderingPosition = -1,
bool isInline = false,
string contentId = "")
{
if (Count >= 2048)
throw new MKAttachment("To many attachments, an msg file can have a maximum of 2048 attachment");
CheckAttachmentFileName(fileName, contentId);
var file = new FileInfo(fileName);
var stream = file.OpenRead();
Add(new Attachment(stream,
file.Name,
file.CreationTime,
file.LastWriteTime,
AttachmentType.ATTACH_BY_VALUE,
renderingPosition,
isInline,
contentId));
}
/// <summary>
/// Adds an <see cref="Attachment" /> stream by <see cref="AttachmentType.ATTACH_BY_VALUE" /> (default)
/// </summary>
/// <param name="stream">The stream to the attachment</param>
/// <param name="fileName">The name for the attachment</param>
/// <param name="renderingPosition">Indicates how an attachment should be displayed in a rich text message</param>
/// <param name="isInline">Set to true to add the attachment inline</param>
/// <param name="contentId">The id for the inline attachment when <paramref name="isInline" /> is set to true</param>
/// <exception cref="ArgumentNullException">Raised when the stream is null</exception>
/// <exception cref="MKAttachmentExists">Raised when an attachment with the same name already exists</exception>
/// <exception cref="ArgumentNullException">
/// Raised when <paramref name="isInline" /> is set to true and
/// <paramref name="contentId" /> is null, white space or empty
/// </exception>
public void Add(Stream stream,
string fileName,
long renderingPosition = -1,
bool isInline = false,
string contentId = "")
{
if (Count >= 2048)
throw new MKAttachment("To many attachments, an msg file can have a maximum of 2048 attachment");
if (stream == null)
throw new ArgumentNullException(nameof(stream));
CheckAttachmentFileName(fileName, contentId);
var dateTime = DateTime.Now;
Add(new Attachment(stream,
fileName,
dateTime,
dateTime,
AttachmentType.ATTACH_BY_VALUE,
renderingPosition,
isInline,
contentId));
}
/// <summary>
/// Adds an <see cref="Attachment" /> stream by <see cref="AttachmentType.ATTACH_BY_VALUE" /> (default)
/// </summary>
/// <param name="stream">The stream to the attachment</param>
/// <param name="fileName">The name for the attachment</param>
/// <exception cref="ArgumentNullException">Raised when the stream is null</exception>
/// <exception cref="MKAttachmentExists">Raised when an attachment with the same name already exists</exception>
internal void AddContactPhoto(Stream stream, string fileName)
{
if (stream == null)
throw new ArgumentNullException(nameof(stream));
var dateTime = DateTime.Now;
Add(new Attachment(stream,
fileName,
dateTime,
dateTime,
AttachmentType.ATTACH_BY_VALUE,
-1,
false,
string.Empty,
true));
}
#endregion
#region AddLink
/// <summary>
/// Adds an <see cref="Attachment" /> by <see cref="AttachmentType.ATTACH_BY_REF_ONLY" /> as a link
/// </summary>
/// <param name="file">The <see cref="FileInfo"/></param>
/// <param name="renderingPosition">Indicates how an attachment should be displayed in a rich text message</param>
/// <param name="isInline">Set to true to add the attachment inline</param>
/// <param name="contentId">The id for the inline attachment when <paramref name="isInline" /> is set to true</param>
/// <exception cref="FileNotFoundException">Raised when the <paramref name="file" /> could not be found</exception>
/// <exception cref="MKAttachmentExists">Raised when an attachment with the same name already exists</exception>
/// <exception cref="ArgumentNullException">
/// Raised when <paramref name="isInline" /> is set to true and
/// <paramref name="contentId" /> is null, white space or empty
/// </exception>
/// <remarks>
/// Universal naming convention (UNC) names are recommended for fully-qualified paths, which should be used with
/// <see cref="AttachmentType.ATTACH_BY_REF_ONLY" />.
/// </remarks>
public void AddLink(FileInfo file,
long renderingPosition = -1,
bool isInline = false,
string contentId = "")
{
CheckAttachmentFileName(file.Name, contentId);
Add(new Attachment(
file,
AttachmentType.ATTACH_BY_REF_ONLY,
renderingPosition,
isInline,
contentId));
}
#endregion
}
/// <summary>
/// This class represents an attachment
/// </summary>
public class Attachment
{
#region Fields
private readonly FileInfo _file;
#endregion
#region Properties
/// <summary>
/// The stream to the attachment
/// </summary>
public Stream Stream { get; }
/// <summary>
/// The filename of the attachment
/// </summary>
public string FileName { get; }
/// <summary>
/// The <see cref="AttachmentType"/>
/// </summary>
public AttachmentType Type { get; }
/// <summary>
/// Indicates how an attachment should be displayed in a rich text message. It can be set to an
/// offset in characters, with the first character of the message content as stored in the <see cref="PropertyTags.PR_BODY_W" />
/// (PidTagBody) property being offset 0, or to -1 (0xFFFFFFFF), indicating that the attachment should
/// not be rendered within the message text at all.
/// </summary>
public long RenderingPosition { get; }
/// <summary>
/// True when the attachment is inline
/// </summary>
public bool IsInline { get; }
/// <summary>
/// The content id for an inline attachment
/// </summary>
public string ContentId { get; }
/// <summary>
/// Returns <c>true</c> when the attachment is a contact photo
/// </summary>
/// <remarks>
/// Only valid when the message is a contact card, otherwise always <c>false</c>
/// </remarks>
public bool IsContactPhoto { get; }
/// <summary>
/// The date and time when the attachment was created
/// </summary>
public DateTime CreationTime { get; }
/// <summary>
/// The date and time when the attachment was last modified
/// </summary>
public DateTime LastModificationTime { get; }
#endregion
#region Constructor
/// <summary>
/// Creates a new attachment object and sets all its properties
/// </summary>
/// <param name="stream">The stream to the attachment</param>
/// <param name="fileName">The attachment filename with its full path</param>
/// <param name="creationTime">The date and time when the attachment was created</param>
/// <param name="lastModificationTime">The date and time when the attachment was last modified</param>
/// <param name="type">The <see cref="AttachmentType"/></param>
/// <param name="renderingPosition">Indicates how an attachment should be displayed in a rich text message</param>
/// <param name="isInline">True when the attachment is inline</param>
/// <param name="contentId">The id for the attachment when <paramref name="isInline" /> is set to true</param>
/// <param name="isContactPhoto">Set to <c>true</c> when the attachment is a contact photo</param>
/// <exception cref="ArgumentNullException">
/// Raised when <paramref name="isInline" /> is set to true and
/// <paramref name="contentId" /> is null, white space or empty
/// </exception>
internal Attachment(Stream stream,
string fileName,
DateTime creationTime,
DateTime lastModificationTime,
AttachmentType type = AttachmentType.ATTACH_BY_VALUE,
long renderingPosition = -1,
bool isInline = false,
string contentId = "",
bool isContactPhoto = false)
{
Stream = stream;
FileName = Path.GetFileName(fileName);
CreationTime = creationTime;
LastModificationTime = lastModificationTime;
Type = type;
RenderingPosition = renderingPosition;
IsInline = isInline;
ContentId = contentId;
IsContactPhoto = isContactPhoto;
if (isInline && string.IsNullOrWhiteSpace(contentId))
throw new ArgumentNullException(nameof(contentId),
"The content id cannot be empty when isInline is set to true");
}
/// <summary>
/// Creates a new attachment object and sets all its properties
/// </summary>
/// <param name="file">The <see cref="FileInfo"/></param>
/// <param name="type">The <see cref="AttachmentType"/></param>
/// <param name="renderingPosition">Indicates how an attachment should be displayed in a rich text message</param>
/// <param name="isInline">True when the attachment is inline</param>
/// <param name="contentId">The id for the attachment when <paramref name="isInline" /> is set to true</param>
/// <param name="isContactPhoto">Set to <c>true</c> when the attachment is a contact photo</param>
/// <exception cref="ArgumentNullException">
/// Raised when <paramref name="isInline" /> is set to true and
/// <paramref name="contentId" /> is null, white space or empty
/// </exception>
internal Attachment(FileInfo file,
AttachmentType type = AttachmentType.ATTACH_BY_VALUE,
long renderingPosition = -1,
bool isInline = false,
string contentId = "",
bool isContactPhoto = false)
{
_file = file;
Stream = file.OpenRead();
FileName = file.Name;
CreationTime = file.CreationTime;
LastModificationTime = file.LastWriteTime;
Type = type;
RenderingPosition = renderingPosition;
IsInline = isInline;
ContentId = contentId;
IsContactPhoto = isContactPhoto;
if (isInline && string.IsNullOrWhiteSpace(contentId))
throw new ArgumentNullException(nameof(contentId),
"The content id cannot be empty when isInline is set to true");
}
#endregion
#region GetShortFileName
/// <summary>
/// This method will convert a long filename to a short dos 8.3 one
/// </summary>
/// <param name="fileName">The long filename</param>
/// <returns></returns>
private static string GetShortFileName(string fileName)
{
var name = Path.GetFileNameWithoutExtension(fileName);
var extension = Path.GetExtension(fileName);
if (name != null)
name = (name.Length > 8 ? name.Substring(0, 6) + "~1" : name).ToUpperInvariant();
if (extension != null)
name += "." +
(extension.Length > 3 ? extension.Substring(1, 3) : extension.TrimStart('.'))
.ToUpperInvariant();
return name;
}
#endregion
#region WriteProperties
/// <summary>
/// Writes all the string and binary <see cref="Property">properties</see> as a <see cref="OpenMcdf.CfbStream" /> to the
/// given <paramref name="storage" />
/// </summary>
/// <param name="storage">The <see cref="OpenMcdf.Storage" /></param>
/// <param name="index">The <see cref="Attachment"/> index</param>
/// <returns>
/// Total size of the written <see cref="Attachment"/> object and it's <see cref="Properties"/>
/// </returns>
internal long WriteProperties(Storage storage, int index)
{
var propertiesStream = new AttachmentProperties();
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_NUM, index, PropertyFlags.PROPATTR_READABLE);
propertiesStream.AddProperty(PropertyTags.PR_INSTANCE_KEY, Mapi.GenerateInstanceKey(), PropertyFlags.PROPATTR_READABLE);
propertiesStream.AddProperty(PropertyTags.PR_RECORD_KEY, Mapi.GenerateRecordKey(), PropertyFlags.PROPATTR_READABLE);
propertiesStream.AddProperty(PropertyTags.PR_RENDERING_POSITION, RenderingPosition, PropertyFlags.PROPATTR_READABLE);
propertiesStream.AddProperty(PropertyTags.PR_OBJECT_TYPE, MapiObjectType.MAPI_ATTACH);
if (IsContactPhoto)
propertiesStream.AddProperty(PropertyTags.PR_ATTACHMENT_CONTACTPHOTO, true, PropertyFlags.PROPATTR_READABLE);
if (!string.IsNullOrEmpty(FileName))
{
propertiesStream.AddProperty(PropertyTags.PR_DISPLAY_NAME_W, FileName);
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_FILENAME_W, GetShortFileName(FileName));
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_LONG_FILENAME_W, FileName);
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_EXTENSION_W, Path.GetExtension(FileName));
if (!string.IsNullOrEmpty(ContentId))
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_CONTENT_ID_W, ContentId);
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_MIME_TAG_W, MimeTypes.GetMimeType(FileName));
}
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_METHOD, Type);
switch (Type)
{
case AttachmentType.ATTACH_BY_VALUE:
case AttachmentType.ATTACH_EMBEDDED_MSG:
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_DATA_BIN, Stream.ToByteArray());
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_SIZE, Stream.Length);
break;
case AttachmentType.ATTACH_BY_REF_ONLY:
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_DATA_BIN, Array.Empty<byte>());
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_SIZE, _file.Length);
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_LONG_PATHNAME_W, _file.FullName);
break;
//case AttachmentType.ATTACH_EMBEDDED_MSG:
// var msgStorage = storage.AddStorage(PropertyTags.PR_ATTACH_DATA_BIN.Name);
// var cf = new CompoundFile(Stream);
// Storage.Copy(cf.RootStorage, msgStorage);
// propertiesStream.AddProperty(PropertyTags.PR_ATTACH_SIZE, Stream.Length);
// propertiesStream.AddProperty(PropertyTags.PR_ATTACH_ENCODING, 0);
// break;
case AttachmentType.ATTACH_BY_REFERENCE:
case AttachmentType.ATTACH_BY_REF_RESOLVE:
case AttachmentType.NO_ATTACHMENT:
case AttachmentType.ATTACH_OLE:
throw new NotSupportedException("AttachByReference, AttachByRefResolve, NoAttachment and AttachOle are not supported");
}
if (IsInline)
{
propertiesStream.AddProperty(PropertyTags.PR_ATTACHMENT_HIDDEN, true);
propertiesStream.AddProperty(PropertyTags.PR_ATTACH_FLAGS, AttachmentFlags.ATT_MHTML_REF);
}
var utcNow = DateTime.UtcNow;
propertiesStream.AddProperty(PropertyTags.PR_CREATION_TIME, utcNow);
propertiesStream.AddProperty(PropertyTags.PR_LAST_MODIFICATION_TIME, utcNow);
propertiesStream.AddProperty(PropertyTags.PR_STORE_SUPPORT_MASK, StoreSupportMaskConst.StoreSupportMask, PropertyFlags.PROPATTR_READABLE);
return propertiesStream.WriteProperties(storage);
}
#endregion
}
================================================
FILE: MsgKit/Contact.cs
================================================
//
// Contact.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MsgKit.Enums;
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// A class used to make a new Outlook contact MSG file
/// </summary>
public class Contact : Email
{
#region Properties
/// <summary>
/// The contact image, this needs to be an JPG file
/// </summary>
public byte[] ContactPicture { get; set; }
/// <summary>
/// File the contact card as ...
/// </summary>
public string FileUnder { get; set; }
/// <summary>
/// The instant messaging address
/// </summary>
public string InstantMessagingAddress { get; set; }
/// <summary>
/// Indicates whether the end-user wants this message object hidden from other users who have access to the message object
/// </summary>
public bool Private { get; set; }
/// <summary>
/// The birthday
/// </summary>
public DateTime? BirthDay { get; set; }
/// <summary>
/// Specifies the wedding anniversary
/// </summary>
public DateTime? WeddingAnniversary { get; set; }
/// <summary>
/// Information about the assistant
/// </summary>
public ContactAssistant Assistant { get; set; }
/// <summary>
/// Contains a telephone number that the message recipient can use to reach the sender
/// </summary>
public string CallBackTelePhoneNumber { get; set; }
/// <summary>
/// Contains the recipient's car telephone number
/// </summary>
public string CarTelePhoneNumber { get; set; }
/// <summary>
/// The names of the childrens
/// </summary>
public List<string> ChildrensNames { get; set; }
/// <summary>
/// The company's main info
/// </summary>
public ContactCompanyMain CompanyMain { get; set; }
/// <summary>
/// The department name
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// Contains a generational abbreviation that follows the full name of the recipient
/// </summary>
public string Generation { get; set; }
/// <summary>
/// Contains the first or given name of the recipient
/// </summary>
public string GivenName { get; set; }
/// <summary>
/// Contains the initials for parts of the full name of the recipient
/// </summary>
public string Initials { get; set; }
/// <summary>
/// Contains the recipient's ISDN-capable telephone number
/// </summary>
// ReSharper disable once InconsistentNaming
public string ISDNNumber { get; set; }
/// <summary>
/// Contains a value that indicates the language in which the messaging user is writing messages
/// </summary>
public string Language { get; set; }
/// <summary>
/// Contains the location of the recipient in a format that is useful to the recipient's organization.
/// </summary>
public string Location { get; set; }
/// <summary>
/// Contains the name of the recipient's manager
/// </summary>
public string ManagerName { get; set; }
/// <summary>
/// Contains the middle name of a contact
/// </summary>
public string MiddleName { get; set; }
/// <summary>
/// Contains the recipient's cellular telephone number
/// </summary>
public string MobileTelephoneNumber { get; set; }
/// <summary>
/// Contains the nickname of the contact
/// </summary>
public string NickName { get; set; }
/// <summary>
/// Contains the recipient's office location
/// </summary>
public string OfficeLocation { get; set; }
/// <summary>
/// Contains the recipient's office location
/// </summary>
public string OfficeTelephoneNumber { get; set; }
/// <summary>
/// Contains the URL of a user's personal home page
/// </summary>
public string PersonalHomePage { get; set; }
/// <summary>
/// Contains the recipient's postal address
/// </summary>
public string PostalAddress { get; set; }
/// <summary>
/// Contains the telephone number of the recipient's primary fax machine
/// </summary>
public string PrimaryFaxNumber { get; set; }
/// <summary>
/// Contains the recipient's primary telephone number
/// </summary>
public string PrimaryTelephoneNumber { get; set; }
/// <summary>
/// Contains the profession of the user
/// </summary>
public string Profession { get; set; }
/// <summary>
/// Contains the recipient's radio telephone number
/// </summary>
public string RadioTelephoneNumber { get; set; }
/// <summary>
/// Contains the user's spouse name
/// </summary>
public string SpouseName { get; set; }
/// <summary>
/// Contains the last or surname of the recipient
/// </summary>
public string SurName { get; set; }
/// <summary>
/// Contains the recipient's telex number
/// </summary>
public string TelexNumber { get; set; }
/// <summary>
/// Contains the recipient's job title
/// </summary>
public string Title { get; set; }
/// <summary>
/// Contains the telephone number for the contact's text telephone (TTY) or telecommunication device for the deaf (TDD)
/// </summary>
// ReSharper disable once InconsistentNaming
public string TTYTDDPhoneNumber { get; set; }
/// <summary>
/// Contains the recipient's pager telephone number
/// </summary>
public string PagerTelephoneNumber { get; set; }
/// <summary>
/// E-mail address 1
/// </summary>
public Address Email1 { get; set; }
/// <summary>
/// E-mail address 2
/// </summary>
public Address Email2 { get; set; }
/// <summary>
/// E-mail address 3
/// </summary>
public Address Email3 { get; set; }
///// <summary>
///// Fax 1
///// </summary>
//public string Fax1 { get; set; }
///// <summary>
///// Fax 2
///// </summary>
//public string Fax2 { get; set; }
///// <summary>
///// Fax 3
///// </summary>
//public string Fax3 { get; set; }
/// <summary>
/// Yomi name and Yomi company name are fields for entering the phonetic equivalent for Japanese names.
/// In Japan, there is commonly a Furigana equivalent for the Kanji name that is used for sorting and searching.
/// </summary>
public ContactYomi Yomi { get; set; }
/// <summary>
/// The work details
/// </summary>
public ContactWork Work { get; set; }
/// <summary>
/// The business details
/// </summary>
public ContactBusiness Business { get; set; }
/// <summary>
/// The home details
/// </summary>
public ContactHome Home { get; set; }
/// <summary>
/// The other address
/// </summary>
public ContactOther Other { get; set; }
/// <summary>
/// Specifies which physical address is the contact's mailing address
/// </summary>
public PostalAddressId PostalAddressId { get; set; }
#endregion
#region Constructors
/// <summary>
/// Creates this object and sets all the needed properties
/// </summary>
/// <param name="sender">The <see cref="Email.Sender"/> of the E-mail</param>
/// <param name="representing">The <see cref="MsgKit.Representing"/> sender of the E-mail</param>
/// <param name="subject">The subject of the E-mail</param>
/// <param name="draft">Set to <c>true</c> to save the E-mail as a draft message</param>
/// <param name="readReceipt">Set to <c>true</c> to request a read receipt for the E-mail</param>
public Contact(
Sender sender,
Representing representing,
string subject,
bool draft = false,
bool readReceipt = false) : base(sender, representing, subject, draft, readReceipt)
{
}
/// <summary>
/// Creates this object and sets all the needed properties
/// </summary>
/// <param name="sender">The <see cref="Email.Sender"/> of the E-mail</param>
/// <param name="subject">The subject of the E-mail</param>
/// <param name="draft">Set to <c>true</c> to save the E-mail as a draft message</param>
/// <param name="readReceipt">Set to <c>true</c> to request a read receipt for the E-mail</param>
public Contact(
Sender sender,
string subject,
bool draft = false,
bool readReceipt = false) : base(sender, subject, draft, readReceipt)
{
}
#endregion
#region WriteToStorage
/// <summary>
/// Writes all the properties that are part of the <see cref="Appointment"/> object either as <see cref="OpenMcdf.Storage"/>'s
/// or <see cref="OpenMcdf.CfbStream"/>'s to the <see cref="OpenMcdf.RootStorage"/>
/// </summary>
private new void WriteToStorage()
{
Class = MessageClass.IPM_Contact;
if (ContactPicture != null)
{
var memoryStream = new MemoryStream(ContactPicture);
Attachments.AddContactPhoto(memoryStream, "ContactPicture.jpg");
NamedProperties.AddProperty(NamedPropertyTags.PidLidHasPicture, true);
NamedProperties.AddProperty(NamedPropertyTags.PidLidSmartNoAttach, true);
}
else
NamedProperties.AddProperty(NamedPropertyTags.PidLidHasPicture, false);
if (!string.IsNullOrWhiteSpace(FileUnder))
NamedProperties.AddProperty(NamedPropertyTags.PidLidFileUnder, FileUnder);
if (!string.IsNullOrWhiteSpace(InstantMessagingAddress))
NamedProperties.AddProperty(NamedPropertyTags.PidLidInstantMessagingAddress, InstantMessagingAddress);
NamedProperties.AddProperty(NamedPropertyTags.PidLidPrivate, Private);
if (BirthDay.HasValue)
{
NamedProperties.AddProperty(NamedPropertyTags.PidLidBirthdayLocal, BirthDay);
TopLevelProperties.AddProperty(PropertyTags.PR_BIRTHDAY, BirthDay);
}
if (WeddingAnniversary.HasValue)
{
NamedProperties.AddProperty(NamedPropertyTags.PidLidWeddingAnniversaryLocal, WeddingAnniversary);
TopLevelProperties.AddProperty(PropertyTags.PR_WEDDING_ANNIVERSARY, WeddingAnniversary);
}
if (Assistant != null)
{
if (!string.IsNullOrWhiteSpace(Assistant.Name))
TopLevelProperties.AddProperty(PropertyTags.PR_ASSISTANT_W, Assistant.Name);
if (!string.IsNullOrWhiteSpace(Assistant.TelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_ASSISTANT_TELEPHONE_NUMBER_W,
Assistant.TelephoneNumber);
}
if (!string.IsNullOrWhiteSpace(CallBackTelePhoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_CALLBACK_TELEPHONE_NUMBER_W, CallBackTelePhoneNumber);
if (!string.IsNullOrWhiteSpace(CarTelePhoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_CAR_TELEPHONE_NUMBER_W, CarTelePhoneNumber);
if (ChildrensNames != null)
TopLevelProperties.AddProperty(PropertyTags.PR_CHILDRENS_NAMES_W, string.Join(", ", ChildrensNames));
if (CompanyMain != null)
{
if (!string.IsNullOrWhiteSpace(CompanyMain.Name))
TopLevelProperties.AddProperty(PropertyTags.PR_COMPANY_NAME_W, CompanyMain.Name);
if (!string.IsNullOrWhiteSpace(CompanyMain.TelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_COMPANY_MAIN_PHONE_NUMBER_W,
CompanyMain.TelephoneNumber);
}
if (!string.IsNullOrWhiteSpace(DepartmentName))
TopLevelProperties.AddProperty(PropertyTags.PR_DEPARTMENT_NAME_W, DepartmentName);
if (!string.IsNullOrWhiteSpace(Generation))
TopLevelProperties.AddProperty(PropertyTags.PR_GENERATION_W, Generation);
if (!string.IsNullOrWhiteSpace(GivenName))
TopLevelProperties.AddProperty(PropertyTags.PR_GIVEN_NAME_W, GivenName);
if (!string.IsNullOrWhiteSpace(Initials))
TopLevelProperties.AddProperty(PropertyTags.PR_INITIALS_W, Initials);
if (!string.IsNullOrWhiteSpace(ISDNNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_ISDN_NUMBER_W, ISDNNumber);
if (!string.IsNullOrWhiteSpace(Language))
TopLevelProperties.AddProperty(PropertyTags.PR_LANGUAGE_W, Language);
if (!string.IsNullOrWhiteSpace(Location))
TopLevelProperties.AddProperty(PropertyTags.PR_LOCATION_W, Location);
if (!string.IsNullOrWhiteSpace(ManagerName))
TopLevelProperties.AddProperty(PropertyTags.PR_MANAGER_NAME_W, ManagerName);
if (!string.IsNullOrWhiteSpace(MiddleName))
TopLevelProperties.AddProperty(PropertyTags.PR_MIDDLE_NAME_W, MiddleName);
if (!string.IsNullOrWhiteSpace(MobileTelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_MOBILE_TELEPHONE_NUMBER_W, MobileTelephoneNumber);
if (!string.IsNullOrWhiteSpace(NickName))
TopLevelProperties.AddProperty(PropertyTags.PR_NICKNAME_W, NickName);
if (!string.IsNullOrWhiteSpace(OfficeLocation))
TopLevelProperties.AddProperty(PropertyTags.PR_OFFICE_LOCATION_W, OfficeLocation);
if (!string.IsNullOrWhiteSpace(OfficeTelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS2_TELEPHONE_NUMBER_W, OfficeTelephoneNumber);
if (!string.IsNullOrWhiteSpace(PersonalHomePage))
TopLevelProperties.AddProperty(PropertyTags.PR_PERSONAL_HOME_PAGE_W, PersonalHomePage);
if (!string.IsNullOrWhiteSpace(PostalAddress))
TopLevelProperties.AddProperty(PropertyTags.PR_POSTAL_ADDRESS_W, PostalAddress);
var addressBookProviderEmailList = new List<long>();
if (!string.IsNullOrWhiteSpace(PrimaryFaxNumber))
{
TopLevelProperties.AddProperty(PropertyTags.PR_PRIMARY_FAX_NUMBER_W, PrimaryFaxNumber);
addressBookProviderEmailList.Add(5);
}
if (!string.IsNullOrWhiteSpace(PrimaryTelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_PRIMARY_TELEPHONE_NUMBER_W, PrimaryTelephoneNumber);
if (!string.IsNullOrWhiteSpace(Profession))
TopLevelProperties.AddProperty(PropertyTags.PR_PROFESSION_W, Profession);
if (!string.IsNullOrWhiteSpace(RadioTelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_RADIO_TELEPHONE_NUMBER_W, RadioTelephoneNumber);
if (!string.IsNullOrWhiteSpace(SpouseName))
TopLevelProperties.AddProperty(PropertyTags.PR_SPOUSE_NAME_W, SpouseName);
if (!string.IsNullOrWhiteSpace(SurName))
TopLevelProperties.AddProperty(PropertyTags.PR_SURNAME_W, SurName);
if (!string.IsNullOrWhiteSpace(TelexNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_TELEX_NUMBER_W, TelexNumber);
if (!string.IsNullOrWhiteSpace(Title))
TopLevelProperties.AddProperty(PropertyTags.PR_TITLE_W, Title);
if (!string.IsNullOrWhiteSpace(TTYTDDPhoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_TTYTDD_PHONE_NUMBER_W, TTYTDDPhoneNumber);
if (!string.IsNullOrWhiteSpace(PagerTelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_PAGER_TELEPHONE_NUMBER_W, PagerTelephoneNumber);
var emailList = new List<long>();
if (Email1 != null)
{
emailList.Add(NamedPropertyTags.PidLidEmail1DisplayName.Id);
addressBookProviderEmailList.Add(0);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail1EmailAddress, Email1.Email);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail1DisplayName, Email1.DisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail1OriginalDisplayName,
Email1.OriginalDisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail1AddressType, Email1.AddressTypeString);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail1OriginalEntryId,
Email1.OneOffEntryId.ToByteArray());
}
if (Email2 != null)
{
emailList.Add(NamedPropertyTags.PidLidEmail2DisplayName.Id);
addressBookProviderEmailList.Add(1);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail2EmailAddress, Email2.Email);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail2DisplayName, Email2.DisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail2OriginalDisplayName,
Email2.OriginalDisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail2AddressType, Email2.AddressTypeString);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail2OriginalEntryId,
Email2.OneOffEntryId.ToByteArray());
}
if (Email3 != null)
{
emailList.Add(NamedPropertyTags.PidLidEmail3DisplayName.Id);
addressBookProviderEmailList.Add(2);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail3EmailAddress, Email3.Email);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail3DisplayName, Email3.DisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail3OriginalDisplayName,
Email3.OriginalDisplayName);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail3AddressType, Email3.AddressTypeString);
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmail3OriginalEntryId,
Email3.OneOffEntryId.ToByteArray());
}
if (emailList.Any())
NamedProperties.AddProperty(NamedPropertyTags.PidLidEmailList, emailList.ToArray());
//if (!string.IsNullOrWhiteSpace(Fax1))
//{
// var fax1 = new Address(Fax1, SubjectNormalized, AddressType.Fax);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax1EmailAddress, fax1.Email);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax1OriginalDisplayName, fax1.OriginalDisplayName);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax1AddressType, fax1.AddressTypeString);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax1OriginalEntryId, fax1.OneOffEntryId.ToByteArray());
//}
//if (!string.IsNullOrWhiteSpace(Fax2))
//{
// var fax2 = new Address(Fax2, SubjectNormalized, AddressType.Fax);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax2EmailAddress, fax2.Email);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax2OriginalDisplayName, fax2.OriginalDisplayName);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax2AddressType, fax2.AddressTypeString);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax2OriginalEntryId, fax2.OneOffEntryId.ToByteArray());
//}
//if (!string.IsNullOrWhiteSpace(Fax3))
//{
// var fax3 = new Address(Fax3, SubjectNormalized, AddressType.Fax);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax3EmailAddress, fax3.Email);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax3OriginalDisplayName, fax3.OriginalDisplayName);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax3AddressType, fax3.AddressTypeString);
// NamedProperties.AddProperty(NamedPropertyTags.PidLidFax3OriginalEntryId, fax3.OneOffEntryId.ToByteArray());
//}
if (Yomi != null)
{
if (!string.IsNullOrWhiteSpace(Yomi.FirstName))
NamedProperties.AddProperty(NamedPropertyTags.PidLidYomiFirstName, Yomi.FirstName);
if (!string.IsNullOrWhiteSpace(Yomi.LastName))
NamedProperties.AddProperty(NamedPropertyTags.PidLidYomiLastName, Yomi.LastName);
if (!string.IsNullOrWhiteSpace(Yomi.CompanyName))
NamedProperties.AddProperty(NamedPropertyTags.PidLidYomiCompanyName, Yomi.CompanyName);
}
if (Work != null)
{
if (!string.IsNullOrWhiteSpace(Work.Address))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddress, Work.Address);
if (!string.IsNullOrWhiteSpace(Work.Street))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressStreet, Work.Street);
if (!string.IsNullOrWhiteSpace(Work.PostalCode))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressPostalCode, Work.PostalCode);
if (!string.IsNullOrWhiteSpace(Work.PostOfficeBox))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressPostOfficeBox, Work.PostOfficeBox);
if (!string.IsNullOrWhiteSpace(Work.City))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressCity, Work.City);
if (!string.IsNullOrWhiteSpace(Work.Country))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressCountry, Work.Country);
if (!string.IsNullOrWhiteSpace(Work.CountryCode))
NamedProperties.AddProperty(NamedPropertyTags.PidLidWorkAddressCountryCode, Work.CountryCode);
}
if (Business != null)
{
if (!string.IsNullOrWhiteSpace(Business.Street))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_ADDRESS_STREET_W, Business.Street);
if (!string.IsNullOrWhiteSpace(Business.City))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_ADDRESS_CITY_W, Business.City);
if (!string.IsNullOrWhiteSpace(Business.Country))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_ADDRESS_COUNTRY_W, Business.Country);
if (!string.IsNullOrWhiteSpace(Business.PostalCode))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_ADDRESS_POSTAL_CODE_W, Business.PostalCode);
if (!string.IsNullOrWhiteSpace(Business.State))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W,
Business.State);
if (!string.IsNullOrWhiteSpace(Business.HomePage))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_HOME_PAGE_W, Business.HomePage);
if (!string.IsNullOrWhiteSpace(Business.TelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_TELEPHONE_NUMBER_W,
Business.TelephoneNumber);
if (!string.IsNullOrWhiteSpace(Business.FaxNumber))
{
TopLevelProperties.AddProperty(PropertyTags.PR_BUSINESS_FAX_NUMBER_W, Business.FaxNumber);
addressBookProviderEmailList.Add(3);
}
}
if (Home != null)
{
if (!string.IsNullOrWhiteSpace(Home.Address))
NamedProperties.AddProperty(NamedPropertyTags.PidLidHomeAddress, Home.Address);
if (!string.IsNullOrWhiteSpace(Home.Street))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_ADDRESS_STREET_W, Home.Street);
if (!string.IsNullOrWhiteSpace(Home.PostalCode))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_ADDRESS_POSTAL_CODE_W, Home.PostalCode);
if (!string.IsNullOrWhiteSpace(Home.City))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_ADDRESS_CITY_W, Home.City);
if (!string.IsNullOrWhiteSpace(Home.Country))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_ADDRESS_COUNTRY_W, Home.Country);
if (!string.IsNullOrWhiteSpace(Home.TelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_TELEPHONE_NUMBER_W, Home.TelephoneNumber);
if (!string.IsNullOrWhiteSpace(Home.TelephoneNumber2))
TopLevelProperties.AddProperty(PropertyTags.PR_HOME2_TELEPHONE_NUMBER_W, Home.TelephoneNumber2);
if (!string.IsNullOrWhiteSpace(Home.FaxNumber))
{
TopLevelProperties.AddProperty(PropertyTags.PR_HOME_FAX_NUMBER_W, Home.FaxNumber);
addressBookProviderEmailList.Add(4);
}
}
if (addressBookProviderEmailList.Any())
NamedProperties.AddProperty(NamedPropertyTags.PidLidAddressBookProviderEmailList,
addressBookProviderEmailList.OrderBy(m => m).ToArray());
if (Other != null)
{
if (!string.IsNullOrWhiteSpace(Other.Address))
NamedProperties.AddProperty(NamedPropertyTags.PidLidOtherAddress, Other.Address);
if (!string.IsNullOrWhiteSpace(Other.Street))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_ADDRESS_STREET_W, Other.Street);
if (!string.IsNullOrWhiteSpace(Other.PostalCode))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_ADDRESS_POSTAL_CODE_W, Other.PostalCode);
if (!string.IsNullOrWhiteSpace(Other.City))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_ADDRESS_CITY_W, Other.City);
if (!string.IsNullOrWhiteSpace(Other.Country))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_ADDRESS_COUNTRY_W, Other.Country);
if (!string.IsNullOrWhiteSpace(Other.State))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_ADDRESS_STATE_OR_PROVINCE_W, Other.State);
if (!string.IsNullOrWhiteSpace(Other.TelephoneNumber))
TopLevelProperties.AddProperty(PropertyTags.PR_OTHER_TELEPHONE_NUMBER_W, Other.TelephoneNumber);
}
}
#endregion
#region Save
/// <summary>
/// Saves the message to the given <paramref name="stream" />
/// </summary>
/// <param name="stream"></param>
public new void Save(Stream stream)
{
WriteToStorage();
base.Save(stream);
}
/// <summary>
/// Saves the message to the given <paramref name="fileName" />
/// </summary>
/// <param name="fileName"></param>
public new void Save(string fileName)
{
WriteToStorage();
base.Save(fileName);
}
#endregion
}
================================================
FILE: MsgKit/ContactAssistant.cs
================================================
//
// ContactAssistant.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> assistent
/// </summary>
public class ContactAssistant
{
#region Properties
/// <summary>
/// The name of the assistant
/// </summary>
public string Name { get; set; }
/// <summary>
/// The telephone number of the assistant
/// </summary>
public string TelephoneNumber { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactBusiness.cs
================================================
//
// ContactBusiness.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> business
/// </summary>
public class ContactBusiness : ContactOther
{
#region Properties
/// <summary>
/// The home-page
/// </summary>
public string HomePage { get; set; }
/// <summary>
/// The fax number
/// </summary>
public string FaxNumber { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactCommon.cs
================================================
//
// ContactCommon.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// A placeholder for the <see cref="ContactWork"/>, <see cref="ContactOther"/> and <see cref="ContactBusiness"/> common properties
/// </summary>
public class ContactCommon
{
#region Properties
/// <summary>
/// The street for the address
/// </summary>
public string Street { get; set; }
/// <summary>
/// The country for the address
/// </summary>
public string Country { get; set; }
/// <summary>
/// The postal code for the address
/// </summary>
public string PostalCode { get; set; }
/// <summary>
/// The city for the address
/// </summary>
public string City { get; set; }
/// <summary>
/// The telephone number
/// </summary>
public string TelephoneNumber { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactCompanyMain.cs
================================================
//
// ContactAssistant.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> company main info
/// </summary>
public class ContactCompanyMain : ContactAssistant
{
}
================================================
FILE: MsgKit/ContactHome.cs
================================================
//
// ContactHome.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> work address
/// </summary>
public class ContactHome : ContactOther
{
#region Properties
/// <summary>
/// The way the home address is displayed in the contact card<br/>
/// Some Street<br/>
/// Zip code Place<br/>
/// Some land<br/>
/// </summary>
public new string Address { get; set; }
/// <summary>
/// The fax number
/// </summary>
public string FaxNumber { get; set; }
/// <summary>
/// The telephone 2 number
/// </summary>
public string TelephoneNumber2 { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactOther.cs
================================================
//
// ContactOther.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> other address
/// </summary>
public class ContactOther : ContactCommon
{
#region Properties
/// <summary>
/// The way the home address is displayed in the contact card<br/>
/// Some Street<br/>
/// Zip code Place<br/>
/// Some land<br/>
/// </summary>
public string Address { get; set; }
/// <summary>
/// The state for the address
/// </summary>
public string State { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactWork.cs
================================================
//
// ContactWork.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> work address
/// </summary>
public class ContactWork : ContactCommon
{
#region Properties
/// <summary>
/// The way the work address is displayed in the contact card<br/>
/// Some Street<br/>
/// Zip code Place<br/>
/// Some land<br/>
/// </summary>
public string Address { get; set; }
/// <summary>
/// The post office box for the address
/// </summary>
public string PostOfficeBox { get; set; }
/// <summary>
/// The country code for the address
/// </summary>
public string CountryCode { get; set; }
#endregion
}
================================================
FILE: MsgKit/ContactYomi.cs
================================================
//
// ContactYomi.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// Placeholder for a <see cref="Contact"/> other address
/// </summary>
public class ContactYomi
{
#region Properties
/// <summary>
/// The first name
/// </summary>
public string FirstName { get; set; }
/// <summary>
/// The last name
/// </summary>
public string LastName { get; set; }
/// <summary>
/// The company name
/// </summary>
public string CompanyName { get; set; }
#endregion
}
================================================
FILE: MsgKit/Converter.cs
================================================
//
// Converter.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Text;
using MimeKit;
using MsgKit.Exceptions;
using MsgKit.Helpers;
using MsgKit.Streams;
using OpenMcdf;
// ReSharper disable UnusedMember.Global
namespace MsgKit;
/// <summary>
/// This class exposes some methods to convert MSG to EML and vice versa
/// </summary>
public static class Converter
{
#region ConvertEmlToMsg
/// <summary>
/// Converts an EML file to MSG format
/// </summary>
/// <param name="emlFileName">The EML (MIME) file</param>
/// <param name="msgFileName">The MSG file</param>
public static void ConvertEmlToMsg(string emlFileName, string msgFileName)
{
using var emlFile = new FileStream(emlFileName, FileMode.Open);
using var msgFile = new FileStream(msgFileName, FileMode.CreateNew);
ConvertEmlToMsg(emlFile, msgFile);
}
/// <summary>
/// Converts an EML file to MSG format
/// </summary>
/// <param name="emlFile">The EML (MIME) input stream</param>
/// <param name="msgFile">The MSG file output stream</param>
public static void ConvertEmlToMsg(Stream emlFile, Stream msgFile)
{
var eml = MimeMessage.Load(emlFile);
var sender = new Sender(string.Empty, string.Empty);
if (eml.From.Count > 0)
{
var mailAddress = (MailboxAddress)eml.From[0];
sender = new Sender(mailAddress.Address, mailAddress.Name);
}
var representing = new Representing(string.Empty, string.Empty);
if (eml.ResentSender != null)
representing = new Representing(eml.ResentSender.Address, eml.ResentSender.Name);
else if (eml.From.Count > 0)
{
var mailAddress = (MailboxAddress)eml.From[0];
representing = new Representing(mailAddress.Address, mailAddress.Name);
}
var msg = new Email(sender, representing, eml.Subject)
{
InternetMessageId = eml.MessageId
};
if(eml.Date.UtcDateTime > DateTime.MinValue)
{
msg.SentOn = eml.Date.UtcDateTime;
msg.ReceivedOn = eml.Date.UtcDateTime;
}
using (var memoryStream = new MemoryStream())
{
eml.Headers.WriteTo(memoryStream);
msg.TransportMessageHeadersText = Encoding.ASCII.GetString(memoryStream.ToArray());
}
msg.Priority = eml.Priority switch
{
MessagePriority.NonUrgent => Enums.MessagePriority.PRIO_NONURGENT,
MessagePriority.Normal => Enums.MessagePriority.PRIO_NORMAL,
MessagePriority.Urgent => Enums.MessagePriority.PRIO_URGENT,
_ => msg.Priority
};
msg.Importance = eml.Importance switch
{
MessageImportance.Low => Enums.MessageImportance.IMPORTANCE_LOW,
MessageImportance.Normal => Enums.MessageImportance.IMPORTANCE_NORMAL,
MessageImportance.High => Enums.MessageImportance.IMPORTANCE_HIGH,
_ => msg.Importance
};
foreach (var to in eml.To)
{
if (to is not MailboxAddress mailAddress) continue;
msg.Recipients.AddTo(mailAddress.Address, mailAddress.Name);
}
foreach (var cc in eml.Cc)
{
var mailAddress = (MailboxAddress)cc;
msg.Recipients.AddCc(mailAddress.Address, mailAddress.Name);
}
foreach (var bcc in eml.Bcc)
{
var mailAddress = (MailboxAddress)bcc;
msg.Recipients.AddBcc(mailAddress.Address, mailAddress.Name);
}
using (var headerStream = new MemoryStream())
{
eml.Headers.WriteTo(headerStream);
headerStream.Position = 0;
msg.TransportMessageHeadersText = Encoding.ASCII.GetString(headerStream.ToArray());
}
var namelessCount = 0;
var index = 1;
// This loops through the top-level parts (i.e. it doesn't open up attachments and continue to traverse).
// As such, any included messages are just attachments here.
foreach (var bodyPart in eml.BodyParts)
{
var handled = false;
// The first text/plain part (that's not an attachment) is the body part.
if (!bodyPart.IsAttachment && bodyPart is TextPart text)
{
// Sets the first matching inline content type for body parts.
if (msg.BodyText == null && text.IsPlain)
{
msg.BodyText = text.Text;
handled = true;
}
if (msg.BodyHtml == null && text.IsHtml)
{
msg.BodyHtml = text.Text;
handled = true;
}
if (msg.BodyRtf == null && text.IsRichText)
{
msg.BodyRtf = text.Text;
handled = true;
}
}
// If the part hasn't previously been handled by "body" part handling
if (handled) continue;
var attachmentStream = new MemoryStream();
var fileName = bodyPart.ContentType.Name;
var extension = string.Empty;
switch (bodyPart)
{
case MessagePart messagePart:
{
messagePart.Message.WriteTo(attachmentStream);
if (messagePart.Message != null)
fileName = messagePart.Message.Subject;
extension = ".eml";
break;
}
case MessageDispositionNotification notification:
fileName = notification.FileName;
break;
case MessageDeliveryStatus status:
fileName = "details";
extension = ".txt";
status.WriteTo(FormatOptions.Default, attachmentStream, true);
break;
default:
{
var part = (MimePart)bodyPart;
part.Content?.DecodeTo(attachmentStream);
fileName = part.FileName;
break;
}
}
fileName = string.IsNullOrWhiteSpace(fileName)
? $"part_{++namelessCount:00}"
: FileManager.RemoveInvalidFileNameChars(fileName);
if (!string.IsNullOrEmpty(extension))
fileName += extension;
var inline = bodyPart.ContentDisposition != null &&
!string.IsNullOrEmpty(bodyPart.ContentId) &&
bodyPart.ContentDisposition.Disposition.Equals("inline",
StringComparison.InvariantCultureIgnoreCase);
attachmentStream.Position = 0;
try
{
msg.Attachments.Add(attachmentStream, fileName, -1, inline, bodyPart.ContentId);
}
catch (MKAttachmentExists)
{
var tempFileName = Path.GetFileNameWithoutExtension(fileName);
var tempExtension = Path.GetExtension(fileName);
msg.Attachments.Add(attachmentStream, $"{tempFileName}({index}){tempExtension}", -1, inline,
bodyPart.ContentId);
index += 1;
}
}
msg.Save(msgFile);
}
#endregion
#region ConvertMsgToEml
/// <summary>
/// Converts an MSG file to EML format
/// </summary>
/// <param name="msgFileName">The MSG file</param>
/// <param name="emlFileName">The EML (MIME) file</param>
public static void ConvertMsgToEml(string msgFileName, string emlFileName)
{
using var msgFile = new FileStream(msgFileName, FileMode.Open, FileAccess.Read);
using var emlFile = new FileStream(emlFileName, FileMode.CreateNew);
ConvertMsgToEml(msgFile, emlFile);
}
/// <summary>
/// Converts an MSG file to EML format
/// </summary>
/// <param name="msgFile">The MSG file input stream</param>
/// <param name="emlFile">The EML (MIME) output stream</param>
public static void ConvertMsgToEml(Stream msgFile, Stream emlFile)
{
using var rootStorage = RootStorage.Open(msgFile, StorageModeFlags.LeaveOpen);
// Read top-level properties
var propsStream = rootStorage.OpenStream(PropertyTags.PropertiesStreamName);
var topLevelProps = new TopLevelProperties(propsStream);
// Read variable-size properties from substg streams
var subject = ReadUnicodeString(rootStorage, PropertyTags.PR_SUBJECT_W);
var bodyText = ReadUnicodeString(rootStorage, PropertyTags.PR_BODY_W);
var htmlBytes = ReadBinaryProperty(rootStorage, PropertyTags.PR_HTML);
var senderName = ReadUnicodeString(rootStorage, PropertyTags.PR_SENDER_NAME_W);
var senderEmail = ReadUnicodeString(rootStorage, PropertyTags.PR_SENDER_EMAIL_ADDRESS_W);
var senderSmtp = ReadUnicodeString(rootStorage, PropertyTags.PR_SMTP_ADDRESS_W);
var messageId = ReadUnicodeString(rootStorage, PropertyTags.PR_INTERNET_MESSAGE_ID_W);
// Determine sender SMTP address (prefer SMTP over email, discard Exchange DNs)
var senderAddress = senderSmtp ?? senderEmail ?? string.Empty;
if (senderAddress.StartsWith("/O=", StringComparison.OrdinalIgnoreCase))
senderAddress = string.Empty;
// Read fixed properties
var clientSubmitTime = topLevelProps.FirstOrDefault(p => p.Id == PropertyTags.PR_CLIENT_SUBMIT_TIME.Id);
var importance = topLevelProps.FirstOrDefault(p => p.Id == PropertyTags.PR_IMPORTANCE.Id);
var priority = topLevelProps.FirstOrDefault(p => p.Id == PropertyTags.PR_PRIORITY.Id);
// Build MimeMessage
var message = new MimeMessage();
if (!string.IsNullOrEmpty(senderAddress))
message.From.Add(new MailboxAddress(senderName ?? string.Empty, senderAddress));
if (!string.IsNullOrEmpty(subject))
message.Subject = subject;
if (!string.IsNullOrEmpty(messageId))
message.MessageId = messageId;
if (clientSubmitTime != null)
message.Date = new DateTimeOffset(clientSubmitTime.ToDateTime);
if (importance != null)
{
message.Importance = importance.ToInt switch
{
0 => MessageImportance.Low,
2 => MessageImportance.High,
_ => MessageImportance.Normal
};
}
if (priority != null)
{
message.Priority = priority.ToInt switch
{
-1 => MessagePriority.NonUrgent,
1 => MessagePriority.Urgent,
_ => MessagePriority.Normal
};
}
// Read recipients
for (var i = 0; i < topLevelProps.RecipientCount; i++)
{
var storageName = PropertyTags.RecipientStoragePrefix + i.ToString("X8");
if (!rootStorage.TryOpenStorage(storageName, out var recipStorage))
continue;
var recipPropsStream = recipStorage.OpenStream(PropertyTags.PropertiesStreamName);
var recipProps = new RecipientProperties(recipPropsStream);
var displayName = ReadUnicodeString(recipStorage, PropertyTags.PR_DISPLAY_NAME_W);
var emailAddress = ReadUnicodeString(recipStorage, PropertyTags.PR_EMAIL_ADDRESS_W);
var smtpAddress = ReadUnicodeString(recipStorage, PropertyTags.PR_SMTP_ADDRESS_W);
var address = smtpAddress ?? emailAddress ?? string.Empty;
if (address.StartsWith("/O=", StringComparison.OrdinalIgnoreCase))
address = string.Empty;
if (string.IsNullOrEmpty(address))
continue;
var recipientType = recipProps.FirstOrDefault(p => p.Id == PropertyTags.PR_RECIPIENT_TYPE.Id);
var type = recipientType?.ToInt ?? 1;
var mailbox = new MailboxAddress(displayName ?? string.Empty, address);
switch (type)
{
case 1: message.To.Add(mailbox); break;
case 2: message.Cc.Add(mailbox); break;
case 3: message.Bcc.Add(mailbox); break;
}
}
// Build body and read attachments
var builder = new BodyBuilder();
builder.TextBody = bodyText;
if (htmlBytes != null)
builder.HtmlBody = Encoding.UTF8.GetString(htmlBytes);
for (var i = 0; i < topLevelProps.AttachmentCount; i++)
{
var storageName = PropertyTags.AttachmentStoragePrefix + i.ToString("X8");
if (!rootStorage.TryOpenStorage(storageName, out var attachStorage))
continue;
var fileName = ReadUnicodeString(attachStorage, PropertyTags.PR_ATTACH_LONG_FILENAME_W)
?? ReadUnicodeString(attachStorage, PropertyTags.PR_ATTACH_FILENAME_W);
var mimeTag = ReadUnicodeString(attachStorage, PropertyTags.PR_ATTACH_MIME_TAG_W);
var contentId = ReadUnicodeString(attachStorage, PropertyTags.PR_ATTACH_CONTENT_ID_W);
var attachData = ReadBinaryProperty(attachStorage, PropertyTags.PR_ATTACH_DATA_BIN);
if (attachData == null) continue;
var contentType = !string.IsNullOrEmpty(mimeTag)
? ContentType.Parse(mimeTag)
: new ContentType("application", "octet-stream");
if (!string.IsNullOrEmpty(contentId))
{
var attachment = builder.LinkedResources.Add(fileName ?? "inline", attachData, contentType);
attachment.ContentId = contentId;
}
else
{
builder.Attachments.Add(fileName ?? "attachment", attachData, contentType);
}
}
message.Body = builder.ToMessageBody();
message.WriteTo(emlFile);
}
#endregion
#region ReadUnicodeString
/// <summary>
/// Reads a unicode string property from a substg stream in the given storage
/// </summary>
private static string ReadUnicodeString(Storage storage, PropertyTags.PropertyTag tag)
{
if (!storage.TryOpenStream(tag.Name, out var stream))
return null;
using (stream)
using (var reader = new BinaryReader(stream))
{
var bytes = reader.ReadBytes((int)stream.Length);
return Encoding.Unicode.GetString(bytes).TrimEnd('\0');
}
}
#endregion
#region ReadBinaryProperty
/// <summary>
/// Reads a binary property from a substg stream in the given storage
/// </summary>
private static byte[] ReadBinaryProperty(Storage storage, PropertyTags.PropertyTag tag)
{
if (!storage.TryOpenStream(tag.Name, out var stream))
return null;
using (stream)
using (var reader = new BinaryReader(stream))
{
return reader.ReadBytes((int)stream.Length);
}
}
#endregion
}
================================================
FILE: MsgKit/Email.cs
================================================
//
// Email.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using MsgKit.Enums;
using MsgKit.Helpers;
using MsgKit.Mime.Header;
using MsgKit.Rtf;
using MsgKit.Structures;
using OpenMcdf;
using MessageImportance = MsgKit.Enums.MessageImportance;
using MessagePriority = MsgKit.Enums.MessagePriority;
using Stream = System.IO.Stream;
// ReSharper disable GrammarMistakeInComment
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace MsgKit;
/// <summary>
/// A class used to make a new Outlook E-mail MSG file
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc979231.aspx
/// </remarks>
public class Email : Message, IDisposable
{
#region Fields
/// <summary>
/// The <see cref="Regex" /> to find the prefix in a subject
/// </summary>
private static readonly Regex SubjectPrefixRegex = new(@"^(\D{1,3}:\s)(.*)$");
/// <summary>
/// The E-mail <see cref="Recipients" />
/// </summary>
private Recipients _recipients;
/// <summary>
/// The E-mail <see cref="Recipients" />
/// </summary>
private Recipients _replyToRecipients;
/// <summary>
/// The E-mail <see cref="Attachments" />
/// </summary>
private Attachments _attachments;
/// <summary>
/// The subject of the E-mail
/// </summary>
private string _subject;
/// <summary>
/// When set to <c>true</c> then the <see cref="Attachment.Stream"/>'s
/// will not be disposed when calling the <see cref="Dispose"/> method. Default set to <c>false</c>
/// </summary>
private readonly bool _leaveAttachmentStreamsOpen;
#endregion
#region Properties
/// <summary>
/// Returns the sender of the E-mail from the <see cref="Recipients" />
/// </summary>
public Sender Sender { get; }
/// <summary>
/// Contains the e-mail address for the messaging user represented by the <see cref="Sender"/>.
/// </summary>
/// <remarks>
/// These properties are examples of the address properties for the messaging user who is being represented by the
/// <see cref="Receiving" /> user. They must be set by the incoming transport provider, which is also responsible for
/// authorization or verification of the delegate. If no messaging user is being represented, these properties should
/// be set to the e-mail address contained in the PR_RECEIVED_BY_EMAIL_ADDRESS (PidTagReceivedByEmailAddress) property.
/// </remarks>
public Representing Representing { get; }
/// <summary>
/// Returns the E-mail <see cref="Recipients" />
/// </summary>
public Recipients Recipients => _recipients ??= new Recipients();
/// <summary>
/// Returns the E-mail <see cref="Recipients" />
/// </summary>
public Recipients ReplyToRecipients => _replyToRecipients ??= new Recipients();
/// <summary>
/// Contains the e-mail address for the messaging user who receives the message.
/// </summary>
/// <remarks>
/// These properties are examples of the address properties for the messaging user who receives the message. They must
/// be set by the incoming transport provider.
/// </remarks>
public Receiving Receiving { get; set; }
/// <summary>
/// Contains the e-mail address for the messaging user who is represented by the <see cref="Receiving"/> user.
/// </summary>
/// <remarks>
/// These properties are examples of the address properties for the messaging user who is being represented by the
/// <see cref="Receiving" /> user. They must be set by the incoming transport provider, which is also responsible for
/// authorization or verification of the delegate. If no messaging user is being represented, these properties should
/// be set to the e-mail address contained in the PR_RECEIVED_BY_EMAIL_ADDRESS (PidTagReceivedByEmailAddress) property.
/// </remarks>
public ReceivingRepresenting ReceivingRepresenting { get; internal set; }
/// <summary>
/// Returns the subject prefix of the E-mail
/// </summary>
public string SubjectPrefix { get; private set; }
/// <summary>
/// Returns or sets the subject of the E-mail
/// </summary>
public string Subject
{
get => _subject;
set
{
_subject = value;
SetSubject();
}
}
/// <summary>
/// Returns the normalized subject of the E-mail
/// </summary>
public string SubjectNormalized { get; private set; }
/// <summary>
/// Returns or sets the <see cref="Enums.MessagePriority"/>
/// </summary>
public MessagePriority Priority { get; set; }
/// <summary>
/// Returns or sets the <see cref="Enums.MessageImportance"/>
/// </summary>
public MessageImportance Importance { get; set; }
/// <summary>
/// Returns or sets the text body of the E-mail
/// </summary>
public string BodyText { get; set; }
/// <summary>
/// Returns or sets the html body of the E-mail
/// </summary>
public string BodyHtml { get; set; }
/// <summary>
/// The compressed RTF body part
/// </summary>
/// <remarks>
/// When not set then the RTF is generated from <see cref="BodyHtml"/> (when this property is set)
/// </remarks>
public string BodyRtf { get; set; }
/// <summary>
/// Returns or set to <c>true</c> when <see cref="BodyRtf"/> is compressed
/// </summary>
public bool BodyRtfCompressed { get; set; }
/// <summary>
/// The E-mail <see cref="Attachments" />
/// </summary>
public Attachments Attachments => _attachments ??= new Attachments();
/// <summary>
/// Returns or sets the UTC date and time the <see cref="Sender"/> has submitted the
/// <see cref="Message"/>
/// </summary>
/// <remarks>
/// This property has to be set to UTC datetime. When not set then the current date
/// and time is used
/// </remarks>
public DateTime? SentOn { get; set; }
/// <summary>
/// Returns the UTC date and time when the <see cref="Message"/> was received
/// </summary>
/// <remarks>
/// This property has to be set to UTC datetime
/// </remarks>
public DateTime? ReceivedOn { get; set; }
/// <summary>
/// Returns or sets the Internet Message Id
/// </summary>
/// <remarks>
/// Corresponds to the message ID field as specified in [RFC2822].<br/><br/>
/// If set then this value will be used, when not set the value will be read from the
/// <see cref="TransportMessageHeaders"/> when this property is set
/// </remarks>
public string InternetMessageId { get; set; }
/// <summary>
/// Returns or set the value of a Multipurpose Internet Mail Extensions (MIME) message's References header field
/// </summary>
/// <remarks>
/// If set then this value will be used, when not set the value will be read from the
/// <see cref="TransportMessageHeaders"/> when this property is set
/// </remarks>
public string InternetReferences { get; set; }
/// <summary>
/// Returns or sets the original message's PR_INTERNET_MESSAGE_ID (PidTagInternetMessageId) property value
/// </summary>
/// <remarks>
/// If set then this value will be used, when not set the value will be read from the
/// <see cref="TransportMessageHeaders"/> when this property is set
/// </remarks>
public string InReplyToId { get; set; }
/// <summary>
/// Sets or returns the <see cref="TransportMessageHeaders"/> property as a string (text).
/// This property expects the headers as a string
/// </summary>
public string TransportMessageHeadersText
{
set => TransportMessageHeaders = HeaderExtractor.GetHeaders(value);
get => TransportMessageHeaders != null ? TransportMessageHeaders.ToString() : string.Empty;
}
/// <summary>
/// Returns or sets the transport message headers. These are only present when
/// the message has been sent outside an Exchange environment to another mailserver
/// <c>null</c> will be returned when not present
/// </summary>
/// <remarks>
/// Use the <see cref="TransportMessageHeaders"/> property if you want to set
/// the headers directly from a string otherwise see the example code below.
/// </remarks>
/// <example>
/// <code>
/// var email = new Email();
/// email.TransportMessageHeaders = new MessageHeader();
/// // ... do something with it, for example
/// email.TransportMessageHeaders.SetHeaderValue("X-MY-CUSTOM-HEADER", "EXAMPLE VALUE");
/// </code>
/// </example>
public MessageHeader TransportMessageHeaders { get; set; }
/// <summary>
/// Returns <c>true</c> when the message is set as a draft message
/// </summary>
public bool Draft { get; }
/// <summary>
/// Returns <c>true</c> when a read receipt is requested
/// </summary>
public bool ReadRecipient { get; }
/// <summary>
/// Specifies the format for an editor to use to display a message.
/// </summary>
public MessageEditorFormat MessageEditorFormat { get; set; }
#endregion
#region Constructor
/// <summary>
/// Creates this object and sets all the needed properties
/// </summary>
/// <param name="sender">The <see cref="Sender"/> of the E-mail</param>
/// <param name="subject">The subject of the E-mail</param>
/// <param name="draft">Set to <c>true</c> to save the E-mail as a draft message</param>
/// <param name="readReceipt">Set to <c>true</c> to request a read receipt for the E-mail</param>
/// <param name="leaveAttachmentStreamsOpen">When set to <c>true</c> then the <see cref="Attachment.Stream"/>'s
/// will not be disposed when calling the <see cref="Dispose"/> method. Default set to <c>false</c></param>
public Email(Sender sender,
string subject,
bool draft = false,
bool readReceipt = false,
bool leaveAttachmentStreamsOpen = false)
{
Sender = sender;
Subject = subject;
Importance = MessageImportance.IMPORTANCE_NORMAL;
IconIndex = MessageIconIndex.NewMail;
Draft = draft;
ReadRecipient = readReceipt;
_leaveAttachmentStreamsOpen = leaveAttachmentStreamsOpen;
}
/// <summary>
/// Creates this object and sets all the needed properties
/// </summary>
/// <param name="sender">The <see cref="Sender"/> of the E-mail</param>
/// <param name="representing">The <see cref="MsgKit.Representing"/> sender of the E-mail</param>
/// <param name="subject">The subject of the E-mail</param>
/// <param name="draft">Set to <c>true</c> to save the E-mail as a draft message</param>
/// <param name="readReceipt">Set to <c>true</c> to request a read receipt for the E-mail</param>
/// <param name="leaveAttachmentStreamsOpen">When set to <c>true</c> then the <see cref="Attachment.Stream"/>'s
/// will not be disposed when calling the <see cref="Dispose"/> method. Default set to <c>false</c></param>
public Email(Sender sender,
Representing representing,
string subject,
bool draft = false,
bool readReceipt = false,
bool leaveAttachmentStreamsOpen = false)
{
Sender = sender;
Representing = representing;
Subject = subject;
Importance = MessageImportance.IMPORTANCE_NORMAL;
IconIndex = MessageIconIndex.NewMail;
Draft = draft;
ReadRecipient = readReceipt;
_leaveAttachmentStreamsOpen = leaveAttachmentStreamsOpen;
}
#endregion
#region SetSubject
/// <summary>
/// These properties are computed by message store or transport providers from the PR_SUBJECT (PidTagSubject)
/// and PR_SUBJECT_PREFIX (PidTagSubjectPrefix) properties in the following manner. If the PR_SUBJECT_PREFIX
/// is present and is an initial substring of PR_SUBJECT, PR_NORMALIZED_SUBJECT and associated properties are
/// set to the contents of PR_SUBJECT with the prefix removed. If PR_SUBJECT_PREFIX is present, but it is not
/// an initial substring of PR_SUBJECT, PR_SUBJECT_PREFIX is deleted and recalculated from PR_SUBJECT using
/// the following rule: If the string contained in PR_SUBJECT begins with one to three non-numeric characters
/// followed by a colon and a space, then the string together with the colon and the blank becomes the prefix.
/// Numbers, blanks, and punctuation characters are not valid prefix characters. If PR_SUBJECT_PREFIX is not
/// present, it is calculated from PR_SUBJECT using the rule outlined in the previous step.This property then
/// is set to the contents of PR_SUBJECT with the prefix removed.
/// </summary>
/// <remarks>
/// When PR_SUBJECT_PREFIX is an empty string, PR_SUBJECT and PR_NORMALIZED_SUBJECT are the same. Ultimately,
/// this property should be the part of PR_SUBJECT following the prefix. If there is no prefix, this property
/// becomes the same as PR_SUBJECT.
/// </remarks>
protected void SetSubject()
{
if (!string.IsNullOrEmpty(SubjectPrefix) && !string.IsNullOrEmpty(Subject))
{
if (Subject.StartsWith(SubjectPrefix))
{
SubjectNormalized = Subject.Substring(SubjectPrefix.Length);
}
else
{
var matches = SubjectPrefixRegex.Matches(Subject);
if (matches.Count > 0)
{
SubjectPrefix = matches.OfType<Match>().First().Groups[1].Value;
SubjectNormalized = matches.OfType<Match>().First().Groups[2].Value;
}
}
}
else if (!string.IsNullOrEmpty(Subject))
{
var matches = SubjectPrefixRegex.Matches(Subject);
if (matches.Count > 0)
{
SubjectPrefix = matches.OfType<Match>().First().Groups[1].Value;
SubjectNormalized = matches.OfType<Match>().First().Groups[2].Value;
}
else
SubjectNormalized = Subject;
}
else
SubjectNormalized = Subject;
SubjectPrefix ??= string.Empty;
}
#endregion
#region WriteToStorage
/// <summary>
/// Writes all the properties that are part of the <see cref="Email"/> object either as <see cref="OpenMcdf.Storage"/>'s
/// or <see cref="CfbStream"/>'s to the <see cref="RootStorage"/>
/// </summary>
internal void WriteToStorage()
{
var rootStorage = CompoundFile;
if (Class == MessageClass.Unknown)
Class = MessageClass.IPM_Note;
MessageSize += Recipients.WriteToStorage(rootStorage);
MessageSize += Attachments.WriteToStorage(rootStorage);
var recipientCount = Recipients.Count;
var attachmentCount = Attachments.Count;
TopLevelProperties.RecipientCount = recipientCount;
TopLevelProperties.AttachmentCount = attachmentCount;
TopLevelProperties.NextRecipientId = recipientCount;
TopLevelProperties.NextAttachmentId = attachmentCount;
TopLevelProperties.AddProperty(PropertyTags.PR_ENTRYID, Mapi.GenerateEntryId());
TopLevelProperties.AddProperty(PropertyTags.PR_INSTANCE_KEY, Mapi.GenerateInstanceKey());
TopLevelProperties.AddProperty(PropertyTags.PR_STORE_SUPPORT_MASK, StoreSupportMaskConst.StoreSupportMask, PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_STORE_UNICODE_MASK, StoreSupportMaskConst.StoreSupportMask, PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_ALTERNATE_RECIPIENT_ALLOWED, true, PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_HASATTACH, attachmentCount > 0);
if (TransportMessageHeaders != null)
{
TopLevelProperties.AddProperty(PropertyTags.PR_TRANSPORT_MESSAGE_HEADERS_W,
TransportMessageHeaders.ToString());
if (!string.IsNullOrWhiteSpace(TransportMessageHeaders.MessageId))
TopLevelProperties.AddProperty(PropertyTags.PR_INTERNET_MESSAGE_ID_W,
TransportMessageHeaders.MessageId);
if (TransportMessageHeaders.References.Any())
TopLevelProperties.AddProperty(PropertyTags.PR_INTERNET_REFERENCES_W,
TransportMessageHeaders.References.Last());
if (TransportMessageHeaders.InReplyTo.Any())
TopLevelProperties.AddProperty(PropertyTags.PR_IN_REPLY_TO_ID_W,
TransportMessageHeaders.InReplyTo.Last());
}
if (!string.IsNullOrWhiteSpace(InternetMessageId))
TopLevelProperties.AddOrReplaceProperty(PropertyTags.PR_INTERNET_MESSAGE_ID_W, InternetMessageId);
if (!string.IsNullOrWhiteSpace(InternetReferences))
TopLevelProperties.AddOrReplaceProperty(PropertyTags.PR_INTERNET_REFERENCES_W, InternetReferences);
if (!string.IsNullOrWhiteSpace(InReplyToId))
TopLevelProperties.AddOrReplaceProperty(PropertyTags.PR_IN_REPLY_TO_ID_W, InReplyToId);
var messageFlags = MessageFlags.MSGFLAG_UNMODIFIED;
if (attachmentCount > 0)
messageFlags |= MessageFlags.MSGFLAG_HASATTACH;
TopLevelProperties.AddProperty(PropertyTags.PR_INTERNET_CPID, Encoding.UTF8.CodePage);
TopLevelProperties.AddProperty(PropertyTags.PR_BODY_W, BodyText);
if (!string.IsNullOrEmpty(BodyHtml) && !Draft)
{
TopLevelProperties.AddProperty(PropertyTags.PR_HTML, BodyHtml);
TopLevelProperties.AddProperty(PropertyTags.PR_RTF_IN_SYNC, false);
}
else if (string.IsNullOrWhiteSpace(BodyRtf) && !string.IsNullOrWhiteSpace(BodyHtml))
{
BodyRtf = Encapsulator.Encapsulate(BodyHtml);
BodyRtfCompressed = true;
}
if (!string.IsNullOrWhiteSpace(BodyRtf))
{
TopLevelProperties.AddProperty(PropertyTags.PR_RTF_COMPRESSED, new Compressor().Compress(Encoding.ASCII.GetBytes(BodyRtf)));
TopLevelProperties.AddProperty(PropertyTags.PR_RTF_IN_SYNC, BodyRtfCompressed);
}
if (MessageEditorFormat != MessageEditorFormat.EDITOR_FORMAT_DONTKNOW)
TopLevelProperties.AddProperty(PropertyTags.PR_MSG_EDITOR_FORMAT, MessageEditorFormat);
if (ReceivedOn.HasValue && ReceivedOn > DateTime.MinValue)
TopLevelProperties.AddProperty(PropertyTags.PR_MESSAGE_DELIVERY_TIME, ReceivedOn.Value.ToUniversalTime());
if (SentOn.HasValue && SentOn > DateTime.MinValue)
TopLevelProperties.AddProperty(PropertyTags.PR_CLIENT_SUBMIT_TIME, SentOn.Value.ToUniversalTime());
TopLevelProperties.AddProperty(PropertyTags.PR_ACCESS, MapiAccess.MAPI_ACCESS_DELETE | MapiAccess.MAPI_ACCESS_MODIFY | MapiAccess.MAPI_ACCESS_READ);
TopLevelProperties.AddProperty(PropertyTags.PR_ACCESS_LEVEL, MapiAccess.MAPI_ACCESS_MODIFY);
TopLevelProperties.AddProperty(PropertyTags.PR_OBJECT_TYPE, MapiObjectType.MAPI_MESSAGE);
SetSubject();
TopLevelProperties.AddProperty(PropertyTags.PR_SUBJECT_W, Subject);
TopLevelProperties.AddProperty(PropertyTags.PR_NORMALIZED_SUBJECT_W, SubjectNormalized);
TopLevelProperties.AddProperty(PropertyTags.PR_SUBJECT_PREFIX_W, SubjectPrefix);
TopLevelProperties.AddProperty(PropertyTags.PR_CONVERSATION_TOPIC_W, SubjectNormalized);
// http://www.meridiandiscovery.com/how-to/e-mail-conversation-index-metadata-computer-forensics/
// http://stackoverflow.com/questions/11860540/does-outlook-embed-a-messageid-or-equivalent-in-its-email-elements
//propertiesStream.AddProperty(PropertyTags.PR_CONVERSATION_INDEX, Subject);
// TODO: Change modification time when this message is opened and only modified
var utcNow = DateTime.UtcNow;
TopLevelProperties.AddProperty(PropertyTags.PR_CREATION_TIME, utcNow);
TopLevelProperties.AddProperty(PropertyTags.PR_LAST_MODIFICATION_TIME, utcNow);
TopLevelProperties.AddProperty(PropertyTags.PR_PRIORITY, Priority);
TopLevelProperties.AddProperty(PropertyTags.PR_IMPORTANCE, Importance);
TopLevelProperties.AddProperty(PropertyTags.PR_MESSAGE_LOCALE_ID, CultureInfo.CurrentCulture.LCID);
if (Draft)
{
messageFlags |= MessageFlags.MSGFLAG_UNSENT;
// Only set the IconIndex when it is not changed from NewEmail to something else
if (IconIndex == MessageIconIndex.NewMail)
IconIndex = MessageIconIndex.UnsentMail;
}
if (ReadRecipient)
{
TopLevelProperties.AddProperty(PropertyTags.PR_READ_RECEIPT_REQUESTED, true);
var reportTag = new ReportTag { ANSIText = Subject };
TopLevelProperties.AddProperty(PropertyTags.PR_REPORT_TAG, reportTag.ToByteArray());
}
TopLevelProperties.AddProperty(PropertyTags.PR_MESSAGE_FLAGS, messageFlags);
TopLevelProperties.AddProperty(PropertyTags.PR_ICON_INDEX, IconIndex);
Sender?.WriteProperties(TopLevelProperties);
Receiving?.WriteProperties(TopLevelProperties);
Representing?.WriteProperties(TopLevelProperties);
ReceivingRepresenting?.WriteProperties(TopLevelProperties);
if (recipientCount > 0)
{
var displayTo = new List<string>();
var displayCc = new List<string>();
var displayBcc = new List<string>();
foreach (var recipient in Recipients)
{
switch (recipient.RecipientType)
{
case RecipientType.To:
if (!string.IsNullOrWhiteSpace(recipient.DisplayName))
displayTo.Add(recipient.DisplayName);
else if (!string.IsNullOrWhiteSpace(recipient.Email))
displayTo.Add(recipient.Email);
break;
case RecipientType.Cc:
if (!string.IsNullOrWhiteSpace(recipient.DisplayName))
displayCc.Add(recipient.DisplayName);
else if (!string.IsNullOrWhiteSpace(recipient.Email))
displayCc.Add(recipient.Email);
break;
case RecipientType.Bcc:
if (!string.IsNullOrWhiteSpace(recipient.DisplayName))
displayBcc.Add(recipient.DisplayName);
else if (!string.IsNullOrWhiteSpace(recipient.Email))
displayBcc.Add(recipient.Email);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
var replyToRecipients = new List<string>();
foreach (var recipient in ReplyToRecipients)
{
replyToRecipients.Add(recipient.Email);
}
TopLevelProperties.AddProperty(PropertyTags.PR_DISPLAY_TO_W, string.Join(";", displayTo),
PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_DISPLAY_CC_W, string.Join(";", displayCc),
PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_DISPLAY_BCC_W, string.Join(";", displayBcc),
PropertyFlags.PROPATTR_READABLE);
TopLevelProperties.AddProperty(PropertyTags.PR_REPLY_RECIPIENT_NAMES_W,
string.Join(";", replyToRecipients), PropertyFlags.PROPATTR_READABLE);
}
}
#endregion
#region Save
/// <summary>
/// Saves the message to the given <paramref name="stream" />
/// </summary>
/// <param name="stream"></param>
public new void Save(Stream stream)
{
WriteToStorage();
base.Save(stream);
}
/// <summary>
/// Saves the message to the given <paramref name="fileName" />
/// </summary>
/// <param name="fileName"></param>
public new void Save(string fileName)
{
WriteToStorage();
base.Save(fileName);
}
#endregion
#region Dispose
/// <summary>
/// Disposes all the attachment streams
/// </summary>
public new void Dispose()
{
if (!_leaveAttachmentStreamsOpen)
foreach (var attachment in _attachments)
attachment.Stream?.Dispose();
base.Dispose();
}
#endregion
}
================================================
FILE: MsgKit/Enums/AddressBookEntryIdType.cs
================================================
//
// AddressBookEntryIdType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// An integer representing the type of the object. It MUST be one of the values from the following table.
/// </summary>
public enum AddressBookEntryIdType
{
/// <summary>
/// A local mail user
/// </summary>
LocalMailUser = 0x00000000,
/// <summary>
/// A distribution list
/// </summary>
DistributionList = 0x00000001,
/// <summary>
/// A bulletinboard or public folder
/// </summary>
BulletinBoardOrPublicFolder = 0x00000002,
/// <summary>
/// An automated mailbox
/// </summary>
AutomatedMailBox = 0x00000003,
/// <summary>
/// An organiztional mailbox
/// </summary>
OrganizationalMailBox = 0x00000004,
/// <summary>
/// A private distribtion list
/// </summary>
PrivateDistributionList = 0x00000005,
/// <summary>
/// A remote mail user
/// </summary>
RemoteMailUser = 0x00000006,
/// <summary>
/// A container
/// </summary>
Container = 0x00000100,
/// <summary>
/// A template
/// </summary>
Template = 0x00000101,
/// <summary>
/// One off user
/// </summary>
OneOffUser = 0x00000102,
/// <summary>
/// Search
/// </summary>
Search = 0x00000200
}
================================================
FILE: MsgKit/Enums/AddressType.cs
================================================
//
// AddressType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// Contains the messaging user's e-mail address type, such as SMTP.
/// </summary>
public enum AddressType
{
/// <summary>
/// Unknown
/// </summary>
Unknown,
/// <summary>
/// Exchange
/// </summary>
Ex,
/// <summary>
/// Simple Mail Transfer Protocol
/// </summary>
Smtp,
/// <summary>
/// Fax
/// </summary>
Fax,
/// <summary>
/// MHS
/// </summary>
Mhs,
/// <summary>
/// PROFS
/// </summary>
Profs,
/// <summary>
/// X400
/// </summary>
X400
}
================================================
FILE: MsgKit/Enums/AppointmentState.cs
================================================
// ReSharper disable InconsistentNaming
//
// AppointmentState.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// Valid values for the <see cref="NamedPropertyTags.PidLidAppointmentStateFlags "/> property
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc815362(v=office.15).aspx
/// </remarks>
public enum AppointmentState : uint
{
/// <summary>
/// This flag indicates that the object is a meeting object or a meeting-related object.
/// </summary>
asfMeeting = 0x00000001,
/// <summary>
/// This flag indicates that the represented object was received from someone else.
/// </summary>
asfReceived = 0x00000002,
/// <summary>
/// This flag indicates that the meeting object represented by the object has been canceled.
/// </summary>
asfCanceled = 0x00000004,
/// <summary>
/// Full update.
/// </summary>
mtgInfo = 0x00020000,
/// <summary>
/// A newer meeting request or meeting update was received after this one.
/// </summary>
mtgOutOfDate = 0x00080000,
/// <summary>
/// This is set on the delegators copy when a delegate handles meeting-related objects.
/// </summary>
mtgDelegatorCopy = 0x00100000
}
================================================
FILE: MsgKit/Enums/AttachmentFlags.cs
================================================
// ReSharper disable InconsistentNaming
//
// AttachmentType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// Contains a bitmask of flags for an attachment.
/// </summary>
/// <remarks>
/// See https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/cc765876(v=office.12)
/// </remarks>
public enum AttachmentFlags : uint
{
/// <summary>
/// Indicates that this attachment is not available to HTML rendering applications and should be ignored in
/// Multipurpose Internet Mail Extensions (MIME) processing.
/// </summary>
ATT_INVISIBLE_IN_HTML = 0x00000001,
/// <summary>
/// Indicates that this attachment is not available to applications rendering in Rich Text Format (RTF) and should be
/// ignored by MAPI.
/// </summary>
ATT_INVISIBLE_IN_RTF = 0x00000002,
/// <summary>
/// The Attachment object is referenced and rendered within the HTML body of the associated Message object.
/// </summary>
ATT_MHTML_REF = 0x00000004
}
================================================
FILE: MsgKit/Enums/AttachmentType.cs
================================================
// ReSharper disable InconsistentNaming
//
// AttachmentType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// The type of the attachment
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc815439.aspx
/// </remarks>
public enum AttachmentType : uint
{
/// <summary>
/// There is no attachment
/// </summary>
NO_ATTACHMENT = 0x00000000,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_DATA_BIN" /> property contains the attachment data
/// </summary>
ATTACH_BY_VALUE = 0x00000001,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_PATHNAME_W" /> or <see cref="PropertyTags.PR_ATTACH_LONG_PATHNAME_W" />
/// property contains a fully qualified path identifying the attachment to recipients with access to a common file server
/// </summary>
ATTACH_BY_REFERENCE = 0x0002,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_PATHNAME_W" /> or <see cref="PropertyTags.PR_ATTACH_LONG_PATHNAME_W" />
/// property contains a fully qualified path identifying the attachment
/// </summary>
ATTACH_BY_REF_RESOLVE = 0x0003,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_PATHNAME_W" /> or <see cref="PropertyTags.PR_ATTACH_LONG_PATHNAME_W" />
/// property contains a fully qualified path identifying the attachment
/// </summary>
ATTACH_BY_REF_ONLY = 0x0004,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_DATA_OBJ" /> (PidTagAttachDataObject) property contains an embedded object
/// that supports the IMessage interface
/// </summary>
ATTACH_EMBEDDED_MSG = 0x0005,
/// <summary>
/// The attachment is an embedded OLE object
/// </summary>
ATTACH_OLE = 0x0006,
/// <summary>
/// The <see cref="PropertyTags.PR_ATTACH_LONG_PATHNAME_W" /> property contains a fully qualified path identifying the attachment.
/// The <see cref="PropertyTags.PR_NAME_A" /> PidNameAttachmentProviderType defines the web service API manipulating the attachment.
/// </summary>
ATTACH_BY_WEB_REFERENCE = 0x0007
}
================================================
FILE: MsgKit/Enums/MapiAccess.cs
================================================
//
// MapiAccess.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Contains a bitmask of flags indicating the operations that are available to the client for the object.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc979218.aspx
/// This property is read-only for the client. It must be a bitwise OR of zero or more values from the following table.
/// </remarks>
[Flags]
public enum MapiAccess : uint
{
/// <summary>
/// Write
/// </summary>
MAPI_ACCESS_MODIFY = 0x00000001,
/// <summary>
/// Read
/// </summary>
MAPI_ACCESS_READ = 0x00000002,
/// <summary>
/// Delete
/// </summary>
MAPI_ACCESS_DELETE = 0x00000004,
/// <summary>
/// Create subfolders in the folder hierarchy
/// </summary>
MAPI_ACCESS_CREATE_HIERARCHY = 0x00000008,
/// <summary>
/// Create content messages
/// </summary>
MAPI_ACCESS_CREATE_CONTENTS = 0x00000010,
/// <summary>
/// Create associated content messages
/// </summary>
MAPI_ACCESS_CREATE_ASSOCIATED = 0x00000020
}
================================================
FILE: MsgKit/Enums/MapiObjectType.cs
================================================
//
// MapiObjectType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Contains the type of an object.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc815487.aspx
/// The object type contained in this property corresponds to the primary interface available for an object accessible
/// through the OpenEntry interface. It is usually obtained by consulting the lpulObjType parameter returned by the
/// appropriate OpenEntry method. When the interface is obtained in other ways, call IMAPIProp::GetProps to obtain the
/// value for this property.
/// </remarks>
[Flags]
public enum MapiObjectType : uint
{
/// <summary>
/// Address book container object
/// </summary>
MAPI_ABCONT = 4,
/// <summary>
/// Address book object
/// </summary>
MAPI_ADDRBOOK = 2,
/// <summary>
/// Message attachment object
/// </summary>
MAPI_ATTACH = 7,
/// <summary>
/// Distribution list object
/// </summary>
MAPI_DISTLIST = 8,
/// <summary>
/// Folder object
/// </summary>
MAPI_FOLDER = 3,
/// <summary>
/// Form object
/// </summary>
MAPI_FORMINFO = 12,
/// <summary>
/// Messaging user object
/// </summary>
MAPI_MAILUSER = 6,
/// <summary>
/// Message object
/// </summary>
MAPI_MESSAGE = 5,
/// <summary>
/// Profile section object
/// </summary>
MAPI_PROFSECT = 9,
/// <summary>
/// Session object
/// </summary>
MAPI_SESSION = 11,
/// <summary>
/// Status object
/// </summary>
MAPI_STATUS = 10,
/// <summary>
/// Message store object
/// </summary>
MAPI_STORE = 1
}
================================================
FILE: MsgKit/Enums/MeetingType.cs
================================================
// ReSharper disable InconsistentNaming
//
// MeetingType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// Valid values for the <see cref="NamedPropertyTags.PidLidMeetingType"/> property
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc815362(v=office.15).aspx
/// </remarks>
public enum MeetingType : uint
{
/// <summary>
/// Unspecified.
/// </summary>
mtgEmpty = 0x00000000,
/// <summary>
/// nitial meeting request.
/// </summary>
mtgRequest = 0x00000001,
/// <summary>
/// Full update.
/// </summary>
mtgFull = 0x00010000,
/// <summary>
/// Full update.
/// </summary>
mtgInfo = 0x00020000,
/// <summary>
/// A newer meeting request or meeting update was received after this one.
/// </summary>
mtgOutOfDate = 0x00080000,
/// <summary>
/// This is set on the delegators copy when a delegate handles meeting-related objects.
/// </summary>
mtgDelegatorCopy = 0x00100000
}
================================================
FILE: MsgKit/Enums/MessageClass.cs
================================================
//
// MessageClass.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// The MessageClass element is an optional element that specifies the message class of this e-mail message.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/ee200767(v=exchg.80).aspx
/// </remarks>
public enum MessageClass
{
/// <summary>
/// The message type is unknown
/// </summary>
Unknown,
/// <summary>
/// Normal e-mail message.
/// </summary>
IPM_Note,
/// <summary>
/// The message is encrypted and can also be signed.
/// </summary>
IPM_Note_SMIME,
/// <summary>
/// The message is clear signed.
/// </summary>
IPM_Note_SMIME_MultipartSigned,
/// <summary>
/// The message is a secure read receipt.
/// </summary>
IPM_Note_Receipt_SMIME,
/// <summary>
/// Post.
/// </summary>
IPM_Post,
/// <summary>
/// Octel voice message.
/// </summary>
IPM_Octel_Voice,
/// <summary>
/// Electronic voice notes.
/// </summary>
IPM_Voicenotes,
/// <summary>
/// Shared message.
/// </summary>
IPM_Sharing,
/// <summary>
/// Non-delivery report for a standard message.
/// </summary>
REPORT_IPM_NOTE_NDR,
/// <summary>
/// Delivery receipt for a standard message.
/// </summary>
REPORT_IPM_NOTE_DR,
/// <summary>
/// Delivery receipt for a delayed message.
/// </summary>
REPORT_IPM_NOTE_DELAYED,
/// <summary>
/// Read receipt for a standard message.
/// </summary>
REPORT_IPM_NOTE_IPNRN,
/// <summary>
/// Non-read receipt for a standard message.
/// </summary>
REPORT_IPM_NOTE_IPNNRN,
/// <summary>
/// Non-delivery report for a meeting request.
/// </summary>
REPORT_IPM_SCHEDULE_MEETING_REQUEST_NDR,
/// <summary>
/// Non-delivery report for a positive meeting response (accept).
/// </summary>
REPORT_IPM_SCHEDULE_MEETING_RESP_POS_NDR,
/// <summary>
/// Non-delivery report for a Tentative meeting response.
/// </summary>
REPORT_IPM_SCHEDULE_MEETING_RESP_TENT_NDR,
/// <summary>
/// Non-delivery report for a cancelled meeting notification.
/// </summary>
REPORT_IPM_SCHEDULE_MEETING_CANCELED_NDR,
/// <summary>
/// Non-delivery report for a Secure MIME (S/MIME) encrypted and opaque-signed message.
/// </summary>
REPORT_IPM_NOTE_SMIME_NDR,
/// <summary>
/// Delivery receipt for an S/MIME encrypted and opaque-signed message.
/// </summary>
REPORT_IPM_NOTE_SMIME_DR,
/// <summary>
/// Non-delivery report for an S/MIME clear-signed message.
/// </summary>
REPORT_IPM_NOTE_SMIME_MULTIPARTSIGNED_NDR,
/// <summary>
/// Delivery receipt for an S/MIME clear-signed message.
/// </summary>
REPORT_IPM_NOTE_SMIME_MULTIPARTSIGNED_DR,
/// <summary>
/// An appointment
/// </summary>
IPM_Appointment,
/// <summary>
/// Task
/// </summary>
IPM_Task,
/// <summary>
/// A contact
/// </summary>
IPM_Contact
}
================================================
FILE: MsgKit/Enums/MessageEditorFormat.cs
================================================
//
// MessageEditorFormat.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Specifies the format for an editor to use to display a message.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc765727.aspx
/// </remarks>
public enum MessageEditorFormat
{
/// <summary>
/// The format for the editor to use is unknown.
/// </summary>
EDITOR_FORMAT_DONTKNOW = 0x00000000,
/// <summary>
/// The editor should display the message in plain text format.
/// </summary>
EDITOR_FORMAT_PLAINTEXT = 0x00000001,
/// <summary>
/// The editor should display the message in HTML format.
/// </summary>
EDITOR_FORMAT_HTML = 0x00000002,
/// <summary>
/// The editor should display the message in Rich Text Format.
/// </summary>
EDITOR_FORMAT_RTF = 0x00000003
}
================================================
FILE: MsgKit/Enums/MessageFlags.cs
================================================
//
// MessageFlags.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Contains a bitmask of flags that indicate the origin and current state of a message.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc839733(v=office.15).aspx
/// This property is a nontransmittable message property exposed at both the sending and receiving ends of a
/// transmission, with different values depending upon the client application or store provider involved. This property
/// is initialized by the client or message store provider when a message is created and saved for the first time and
/// then updated periodically by the message store provider, a transport provider, and the MAPI spooler as the message
/// is processed and its state changes.
/// This property exists on a message both before and after submission, and on all copies of the received
/// message. Although it is not a recipient property, it is exposed differently to each recipient according to whether
/// it has been read or modified by that recipient.
/// </remarks>
[Flags]
public enum MessageFlags : uint
{
/// <summary>
/// The message is marked as having been read. This can occur as the result of a call at any time to
/// IMessage::SetReadFlag or IMAPIFolder::SetReadFlags. Clients can also set this flag by calling a message's
/// IMAPIProp::SetProps method before the message has been saved for the first time. This flag is ignored if the
/// ASSOCIATED flag is set.
/// </summary>
MSGFLAG_READ = 0x0001,
/// <summary>
/// The outgoing message has not been modified since the first time that it was saved; the incoming message has not
/// been modified since it was delivered.
/// </summary>
MSGFLAG_UNMODIFIED = 0x0002,
/// <summary>
/// The message is marked for sending as a result of a call to IMessage::SubmitMessage. Message store providers set
/// this flag; the client has read-only access.
/// </summary>
MSGFLAG_SUBMIT = 0x0004,
/// <summary>
/// The message is still being composed. It is saved, but has not been sent. The client or provider has read/write
/// access to this flag until the first IMAPIProp::SaveChanges call and read-only thereafter. If a client doesn't set
/// this flag by the time the message is sent, the message store provider sets it when IMessage::SubmitMessage is
/// called. Typically, this flag is cleared after the message is sent.
/// </summary>
MSGFLAG_UNSENT = 0x0008,
/// <summary>
/// The message has at least one attachment. This flag corresponds to the message's PR_HASATTACH (PidTagHasAttachments)
/// property. The client has read-only access to this flag.
/// </summary>
MSGFLAG_HASATTACH = 0x0010,
/// <summary>
/// The messaging user sending was the messaging user receiving the message. The client or provider has read/write
/// access to this flag until the first IMAPIProp::SaveChanges call and read-only thereafter. This flag is meant to be
/// set by the transport provider.
/// </summary>
MSGFLAG_FROMME = 0x0020,
/// <summary>
/// The message is an associated message of a folder. The client or provider has read-only access to this flag. The
/// READ flag is ignored for associated messages, which do not retain a read/unread state.
/// </summary>
MSGFLAG_ASSOCIATED = 0x040,
/// <summary>
/// The message includes a request for a resend operation with a nondelivery report. The client or provider has
/// read/write access to this flag until the first IMAPIProp::SaveChanges call and read-only thereafter.
/// </summary>
MSGFLAG_RESEND = 0x0080,
/// <summary>
/// A read report needs to be sent for the message. The client or provider has read-only access to this flag.
/// </summary>
MSGFLAG_NOTIFYREAD = 0x100,
/// <summary>
/// A nonread report needs to be sent for the message. The client or provider has read-only access to this flag.
/// </summary>
MSGFLAG_NOTIFYUNREAD = 0x0200,
/// <summary>
/// The message has been read at least once. This flag is set or cleared by the server whenever the MSGFLAG_READ flag
/// is set or cleared.
/// </summary>
MSGFLAG_EVERREAD = 0x0400,
/// <summary>
/// The incoming message arrived over an X.400 link. It originated either outside the organization or from a source the
/// gateway cannot consider trusted. The client should display an appropriate message to the user. Transport providers
/// set this flag; the client has read-only access.
/// </summary>
MSGFLAG_ORIGIN_X400 = 0x1000,
/// <summary>
/// The incoming message arrived over the Internet. It originated either outside the organization or from a source the
/// gateway cannot consider trusted. The client should display an appropriate message to the user. Transport providers
/// set this flag; the client has read-only access.
/// </summary>
MSGFLAG_ORIGIN_INTERNET = 0x2000,
/// <summary>
/// The incoming message arrived over an external link other than X.400 or the Internet. It originated either outside
/// the organization or from a source the gateway cannot consider trusted. The client should display an appropriate
/// message to the user. Transport providers set this flag; the client has read-only access.
/// </summary>
MSGFLAG_ORIGIN_MISC_EXT = 0x8000
}
================================================
FILE: MsgKit/Enums/MessageFormat.cs
================================================
//
// MessageFormat.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// The messageformat to use
/// </summary>
public enum MessageFormat
{
/// <summary>
/// Send a plain text message body.
/// </summary>
TextOnly,
/// <summary>
/// Send an HTML message body.
/// </summary>
HtmlOnly,
/// <summary>
/// Send a multipart / alternative body with both plain text and HTML.
/// </summary>
TextAndHtml
}
================================================
FILE: MsgKit/Enums/MessageIconIndex.cs
================================================
//
// MessageIconIndex.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
namespace MsgKit.Enums;
/// <summary>
/// Contains a number that indicates which icon to use when you display a group of e-mail objects.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc815472(v=office.15).aspx
/// This property, if it exists, is a hint to the client. The client may ignore the value of this property.
/// </remarks>
[Flags]
public enum MessageIconIndex : uint
{
/// <summary>
/// New mail
/// </summary>
NewMail = 0x00000000,
/// <summary>
/// Post
/// </summary>
Post = 0x00000001,
/// <summary>
/// Other
/// </summary>
Other = 0x00000003,
/// <summary>
/// Read mail
/// </summary>
ReadMail = 0x00000100,
/// <summary>
/// Unread mail
/// </summary>
UnreadMail = 0x00000101,
/// <summary>
/// Submitted mail
/// </summary>
SubmittedMail = 0x00000102,
/// <summary>
/// Unsent mail
/// </summary>
UnsentMail = 0x00000103,
/// <summary>
/// Receipt mail
/// </summary>
ReceiptMail = 0x00000104,
/// <summary>
/// Replied mail
/// </summary>
RepliedMail = 0x00000105,
/// <summary>
/// Forwarded mail
/// </summary>
ForwardedMail = 0x00000106,
/// <summary>
/// Remote mail
/// </summary>
RemoteMail = 0x00000107,
/// <summary>
/// Delivery receipt
/// </summary>
DeliveryReceipt = 0x00000108,
/// <summary>
/// Read receipt
/// </summary>
ReadReceipt = 0x00000109,
/// <summary>
/// Non delivery report
/// </summary>
NondeliveryReport = 0x0000010A,
/// <summary>
/// Non read receipt
/// </summary>
NonReadReceipt = 0x0000010B,
/// <summary>
/// Recall S mail
/// </summary>
RecallSMail = 0x0000010C,
/// <summary>
/// Recall F mail
/// </summary>
RecallFMail = 0x0000010D,
/// <summary>
/// Tracking mail
/// </summary>
TrackingMail = 0x0000010E,
/// <summary>
/// Out of office mail
/// </summary>
OutOfOfficeMail = 0x0000011B,
/// <summary>
/// Recall mail
/// </summary>
RecallMail = 0x0000011C,
/// <summary>
/// Tracked mail
/// </summary>
TrackedMail = 0x00000130,
/// <summary>
/// Contact
/// </summary>
Contact = 0x00000200,
/// <summary>
/// Distribution list
/// </summary>
DistributionList = 0x00000202,
/// <summary>
/// Sticky note blue
/// </summary>
StickyNoteBlue = 0x00000300,
/// <summary>
/// Sticky note green
/// </summary>
StickyNoteGreen = 0x00000301,
/// <summary>
/// Sticky note pink
/// </summary>
StickyNotePink = 0x00000302,
/// <summary>
/// Sticky note yellow
/// </summary>
StickyNoteYellow = 0x00000303,
/// <summary>
/// Sticky note white
/// </summary>
StickyNoteWhite = 0x00000304,
/// <summary>
/// Single instance appointment
/// </summary>
SingleInstanceAppointment = 0x00000400,
/// <summary>
/// Recurring appointment
/// </summary>
RecurringAppointment = 0x00000401,
/// <summary>
/// Single instance meeting
/// </summary>
SingleInstanceMeeting = 0x00000402,
/// <summary>
/// Recurring meeting
/// </summary>
RecurringMeeting = 0x00000403,
/// <summary>
/// Meeting request
/// </summary>
MeetingRequest = 0x00000404,
/// <summary>
/// Accept
/// </summary>
Accept = 0x00000405,
/// <summary>
/// Decline
/// </summary>
Decline = 0x00000406,
/// <summary>
/// Tentativly
/// </summary>
Tentativly = 0x00000407,
/// <summary>
/// Cancellation
/// </summary>
Cancellation = 0x00000408,
/// <summary>
/// Informational update
/// </summary>
InformationalUpdate = 0x00000409,
/// <summary>
/// Task/task
/// </summary>
TaskTask = 0x00000500,
/// <summary>
/// Unassigned recurring task
/// </summary>
UnassignedRecurringTask = 0x00000501,
/// <summary>
/// Assignee's task
/// </summary>
AssigneesTask = 0x00000502,
/// <summary>
/// Assigner's task
/// </summary>
AssignersTask = 0x00000503,
/// <summary>
/// Task request
/// </summary>
TaskRequest = 0x00000504,
/// <summary>
/// Task acceptance
/// </summary>
TaskAcceptance = 0x00000505,
/// <summary>
/// Task rejection
/// </summary>
TaskRejection = 0x00000506,
/// <summary>
/// Journal conversation
/// </summary>
JournalConversation = 0x00000601,
/// <summary>
/// Journal e-mail message
/// </summary>
JournalEmailMessage = 0x00000602,
/// <summary>
/// Journal meeting request
/// </summary>
JournalMeetingRequest = 0x00000603,
/// <summary>
/// Journal meeting response
/// </summary>
JournalMeetingResponse = 0x00000604,
/// <summary>
/// Journal task request
/// </summary>
JournalTaskRequest = 0x00000606,
/// <summary>
/// Journal task response
/// </summary>
JournalTaskResponse = 0x00000607,
/// <summary>
/// Journal note
/// </summary>
JournalNote = 0x00000608,
/// <summary>
/// Journal fax
/// </summary>
JournalFax = 0x00000609,
/// <summary>
/// Journal phone call
/// </summary>
JournalPhoneCall = 0x0000060A,
/// <summary>
/// Journal letter
/// </summary>
JournalLetter = 0x0000060C,
/// <summary>
/// Journal Microsoft Office Word
/// </summary>
JournalMicrosoftOfficeWord = 0x0000060D,
/// <summary>
/// Journal Microsoft Office Excel
/// </summary>
JournalMicrosoftOfficeExcel = 0x0000060E,
/// <summary>
/// Journal Microsoft Office PowerPoint
/// </summary>
JournalMicrosoftOfficePowerPoint = 0x0000060F,
/// <summary>
/// Journal Microsoft Office Access
/// </summary>
JournalMicrosoftOfficeAccess = 0x00000610,
/// <summary>
/// Journal document
/// </summary>
JournalDocument = 0x00000612,
/// <summary>
/// Journal meeting
/// </summary>
JournalMeeting = 0x00000613,
/// <summary>
/// Journal meeting cancellation
/// </summary>
JournalMeetingCancellation = 0x00000614,
/// <summary>
/// Journal remote session
/// </summary>
JournalRemoteSession = 0x00000615
}
================================================
FILE: MsgKit/Enums/MessageImportance.cs
================================================
//
// MessageImportance.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Contains the relative priority of a message.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc815346(v=office.15).aspx
/// </remarks>
public enum MessageImportance
{
/// <summary>
/// The message has low importance.
/// </summary>
IMPORTANCE_LOW = 0,
/// <summary>
/// The message has normal importance.
/// </summary>
IMPORTANCE_NORMAL = 1,
/// <summary>
/// The message has high importance.
/// </summary>
IMPORTANCE_HIGH = 2
}
================================================
FILE: MsgKit/Enums/MessagePriority.cs
================================================
//
// MessagePriority.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// Contains a value that indicates the message sender's opinion of the importance of a message.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc765646(v=office.15).aspx
/// </remarks>
public enum MessagePriority
{
/// <summary>
/// The message is not urgent.
/// </summary>
PRIO_NONURGENT = 0,
/// <summary>
/// The message has normal priority.
/// </summary>
PRIO_NORMAL = 1,
/// <summary>
/// The message is urgent.
/// </summary>
PRIO_URGENT = 2
}
================================================
FILE: MsgKit/Enums/PostalAddressId.cs
================================================
// ReSharper disable InconsistentNaming
//
// PostalAddressId.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// Specifies which physical address is the contact's mailing address
/// </summary>
/// <remarks>
/// See https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidpostaladdressid-canonical-property
/// </remarks>
public enum PostalAddressId : uint
{
/// <summary>
/// No address is selected as the mailing address
/// </summary>
NO_ADDRESS = 0x00000000,
/// <summary>
/// The Home Address is the mailing address
/// </summary>
HOME_ADDRESS = 0x00000001,
/// <summary>
/// The Work Address is the mailing address.
/// </summary>
WORK_ADDRESS = 0x00000002,
/// <summary>
/// The Other Address is the mailing address
/// </summary>
OTHER_ADDRESS = 0x00000003,
}
================================================
FILE: MsgKit/Enums/PropertyFlags.cs
================================================
//
// PropertyFlags.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
namespace MsgKit.Enums;
/// <summary>
/// Flags used to set on a <see cref="Structures.Property" />
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/ee158556(v=exchg.80).aspx
/// </remarks>
[Flags]
public enum PropertyFlags : uint
{
// ReSharper disable InconsistentNaming
/// <summary>
/// If this flag is set for a property, that property MUST NOT be deleted from the .msg file
/// (irrespective of which storage it is contained in) and implementations MUST return an error
/// if any attempt is made to do so. This flag is set in circumstances where the implementation
/// depends on that property always being present in the .msg file once it is written there.
/// </summary>
PROPATTR_MANDATORY = 0x00000001,
/// <summary>
/// If this flag is not set on a property, that property MUST NOT be read from the .msg file
/// and implementations MUST return an error if any attempt is made to read it. This flag is
/// set on all properties unless there is an implementation-specific reason to prevent a property
/// from being read from the .msg file.
/// </summary>
PROPATTR_READABLE = 0x00000002,
/// <summary>
/// If this flag is not set on a property, that property MUST NOT be modified or deleted and
/// implementations MUST return an error if any attempt is made to do so. This flag is set in
/// circumstances where the implementation depends on the properties being writable.
/// </summary>
PROPATTR_WRITABLE = 0x00000004
// ReSharper restore InconsistentNaming
}
================================================
FILE: MsgKit/Enums/PropertyKind.cs
================================================
//
// PropertyKind.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
namespace MsgKit.Enums;
/// <summary>
/// Kind (1 byte): The possible values for the Kind field are in the following table.
/// </summary>
[Flags]
public enum PropertyKind
{
/// <summary>
/// The property is identified by the LID field (numerical named property)
/// </summary>
Lid = 0x00,
/// <summary>
/// The property is identified by the Name field (string named property)
/// </summary>
Name = 0x01,
/// <summary>
/// The property does not have an associated PropertyName field.
/// </summary>
NotAssociated = 0xFF
}
================================================
FILE: MsgKit/Enums/PropertyType.cs
================================================
//
// PropertyType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// The type of a property in the properties stream
/// </summary>
public enum PropertyType : ushort
{
/// <summary>
/// Any: this property type value matches any type; a server MUST return the actual type in its response. Servers
/// MUST NOT return this type in response to a client request other than NspiGetIDsFromNames or the
/// RopGetPropertyIdsFromNamesROP request ([MS-OXCROPS] section 2.2.8.1). (PT_UNSPECIFIED)
/// </summary>
PT_UNSPECIFIED = 0x0000,
/// <summary>
/// None: This property is a placeholder. (PT_NULL)
/// </summary>
PT_NULL = 0x0001,
/// <summary>
/// 2 bytes; a 16-bit integer (PT_I2, i2, ui2)
/// </summary>
PT_SHORT = 0x0002,
/// <summary>
/// 4 bytes; a 32-bit integer (PT_LONG, PT_I4, int, ui4)
/// </summary>
PT_LONG = 0x0003,
/// <summary>
/// 4 bytes; a 32-bit floating point number (PT_FLOAT, PT_R4, float, r4)
/// </summary>
PT_FLOAT = 0x0004,
/// <summary>
/// 8 bytes; a 64-bit floating point number (PT_DOUBLE, PT_R8, r8)
/// </summary>
PT_DOUBLE = 0x0005,
/// <summary>
/// 8 bytes; a 64-bit floating point number in which the whole number part represents the number of days since
/// December 30, 1899, and the fractional part represents the fraction of a day since midnight (PT_APPTIME)
/// </summary>
PT_APPTIME = 0x0007,
/// <summary>
/// 4 bytes; a 32-bit integer encoding error information as specified in section 2.4.1. (PT_ERROR)
/// </summary>
PT_ERROR = 0x000A,
/// <summary>
/// 1 byte; restricted to 1 or 0 (PT_BOOLEAN. bool)
/// </summary>
PT_BOOLEAN = 0x000B,
/// <summary>
/// The property value is a Component Object Model (COM) object, as specified in section 2.11.1.5. (PT_OBJECT)
/// </summary>
PT_OBJECT = 0x000D,
/// <summary>
/// 8 bytes; a 64-bit integer (PT_LONGLONG, PT_I8, i8, ui8)
/// </summary>
PT_I8 = 0x0014,
/// <summary>
/// 8 bytes; a 64-bit integer (PT_LONGLONG, PT_I8, i8, ui8)
/// </summary>
PT_LONGLONG = 0x0014,
/// <summary>
/// Variable size; a string of Unicode characters in UTF-16LE format encoding with terminating null character
/// (0x0000). (PT_UNICODE, string)
/// </summary>
PT_UNICODE = 0x001F,
/// <summary>
/// Variable size; a string of multibyte characters in externally specified encoding with terminating null
/// character (single 0 byte). (PT_STRING8) ... ANSI format
/// </summary>
PT_STRING8 = 0x001E,
/// <summary>
/// 8 bytes; a 64-bit integer representing the number of 100-nanosecond intervals since January 1, 1601
/// (PT_SYSTIME, time, datetime, datetime.tz, datetime.rfc1123, Date, time, time.tz)
/// </summary>
PT_SYSTIME = 0x0040,
/// <summary>
/// 16 bytes; a GUID with Data1, Data2, and Data3 fields in little-endian format (PT_CLSID, UUID)
/// </summary>
PT_CLSID = 0x0048,
/// <summary>
/// Variable size; a 16-bit COUNT field followed by a structure as specified in section 2.11.1.4. (PT_SVREID)
/// </summary>
PT_SVREID = 0x00FB,
/// <summary>
/// Variable size; a byte array representing one or more Restriction structures as specified in section 2.12.
/// (PT_SRESTRICT)
/// </summary>
PT_SRESTRICT = 0x00FD,
/// <summary>
/// Variable size; a 16-bit COUNT field followed by that many rule (4) action (3) structures, as specified in
/// [MS-OXORULE] section 2.2.5. (PT_ACTIONS)
/// </summary>
PT_ACTIONS = 0x00FE,
/// <summary>
/// Variable size; a COUNT field followed by that many bytes. (PT_BINARY)
/// </summary>
PT_BINARY = 0x0102,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_SHORT values. (PT_MV_SHORT, PT_MV_I2, mv.i2)
/// </summary>
PT_MV_SHORT = 0x1002,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_LONG values. (PT_MV_LONG, PT_MV_I4, mv.i4)
/// </summary>
PT_MV_LONG = 0x1003,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_FLOAT values. (PT_MV_FLOAT, PT_MV_R4, mv.float)
/// </summary>
PT_MV_FLOAT = 0x1004,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_DOUBLE values. (PT_MV_DOUBLE, PT_MV_R8)
/// </summary>
PT_MV_DOUBLE = 0x1005,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_CURRENCY values. (PT_MV_CURRENCY, mv.fixed.14.4)
/// </summary>
PT_MV_CURRENCY = 0x1006,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_APPTIME values. (PT_MV_APPTIME)
/// </summary>
PT_MV_APPTIME = 0x1007,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_LONGLONGvalues. (PT_MV_I8, PT_MV_I8)
/// </summary>
PT_MV_LONGLONG = 0x1014,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_UNICODE values. (PT_MV_UNICODE)
/// </summary>
PT_MV_TSTRING = 0x101F,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_UNICODE values. (PT_MV_UNICODE)
/// </summary>
PT_MV_UNICODE = 0x101F,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_STRING8 values. (PT_MV_STRING8, mv.string)
/// </summary>
PT_MV_STRING8 = 0x101E,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_SYSTIME values. (PT_MV_SYSTIME)
/// </summary>
PT_MV_SYSTIME = 0x1040,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_CLSID values. (PT_MV_CLSID, mv.uuid)
/// </summary>
PT_MV_CLSID = 0x1048,
/// <summary>
/// Variable size; a COUNT field followed by that many PT_MV_BINARY values. (PT_MV_BINARY, mv.bin.hex)
/// </summary>
PT_MV_BINARY = 0x1102,
}
================================================
FILE: MsgKit/Enums/RecipientFlags.cs
================================================
//
// RecipientFlags.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
namespace MsgKit.Enums;
/// <summary>
/// Specifies a bit field that describes the recipient status.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/office/cc815629.aspx
/// </remarks>
[Flags]
public enum RecipientFlags : uint
{
/// <summary>
/// The recipient is a Sendable Attendee. This flag is only used in the dispidApptUnsendableRecips
/// (PidLidAppointmentUnsendableRecipients) property.
/// </summary>
RecipSendable = 0x00000001,
/// <summary>
/// The RecipientRow on which this flag is set represents the meeting Organizer.
/// </summary>
RecipOrganizer = 0x0000002,
/// <summary>
/// Indicates that the attendee gave a response for the exception on which this RecipientRow resides. This flag is only
/// used in a RecipientRow of an exception embedded message object of the organizers meeting object.
/// </summary>
RecipExceptionalResponse = 0x00000010,
/// <summary>
/// Indicates that although the RecipientRow exists, it should be treated as if the corresponding recipient does not.
/// This flag is only used in a RecipientRow of an exception embedded message object of the organizers meeting object.
/// </summary>
RecipExceptionalDeleted = 0x00000020,
/// <summary>
/// Indicates the recipient is an original attendee. This flag is only used in the dispidApptUnsendableRecips property.
/// </summary>
RecipOriginal = 0x00000100
}
================================================
FILE: MsgKit/Enums/RecipientRowAddressType.cs
================================================
//
// RecipientRowAddressType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using MsgKit.Structures;
namespace MsgKit.Enums;
/// <summary>
/// The <see cref="RecipientRow.RecipientRowDisplayType" />
/// </summary>
public enum RecipientRowAddressType
{
/// <summary>
/// No type is set
/// </summary>
NoType = 0x0,
/// <summary>
/// X500DN
/// </summary>
X500Dn = 0x1,
/// <summary>
/// Ms mail
/// </summary>
MsMail = 0x2,
/// <summary>
/// SMTP
/// </summary>
Smtp = 0x3,
/// <summary>
/// Fax
/// </summary>
Fax = 0x4,
/// <summary>
/// Professional office system
/// </summary>
ProfessionalOfficeSystem = 0x5,
/// <summary>
/// Personal distribution list 1
/// </summary>
PersonalDistributionList1 = 0x6,
/// <summary>
/// Personal distribution list 2
/// </summary>
PersonalDistributionList2 = 0x7
}
================================================
FILE: MsgKit/Enums/RecipientRowDisplayType.cs
================================================
//
// RecipientRowAddressType.cs
//
// Author: RecipientRowDisplayType and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// An enumeration. This field MUST be present when the Type field
/// of the RecipientFlags field is set to X500DN(0x1) and MUST NOT be present otherwise.This
/// value specifies the display type of this address.Valid values for this field are specified in the
/// following table.
/// </summary>
public enum RecipientRowDisplayType
{
/// <summary>
/// A messaging user
/// </summary>
MessagingUser = 0x00,
/// <summary>
/// A distribution list
/// </summary>
DistributionList = 0x01,
/// <summary>
/// A forum, such as a bulletin board service or a public or shared folder
/// </summary>
Forum = 0x02,
/// <summary>
/// An automated agent
/// </summary>
AutomatedAgent = 0x03,
/// <summary>
/// An Address Book object defined for a large group, such as helpdesk, accounting, coordinator, or
/// department
/// </summary>
AddressBook = 0x04,
/// <summary>
/// A private, personally administered distribution list
/// </summary>
PrivateDistributionList = 0x05,
/// <summary>
/// An Address Book object known to be from a foreign or remote messaging system
/// </summary>
RemoteAddressBook = 0x06
}
================================================
FILE: MsgKit/Enums/RecipientType.cs
================================================
//
// RecipientType.cs
//
// Author: RecipientRowDisplayType and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace MsgKit.Enums;
/// <summary>
/// The recipient type
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/cc839620(v=office.15).aspx
/// </remarks>
public enum RecipientType : uint
{
/// <summary>
/// The recipient is the message originator
/// </summary>
Originator = 0x0000,
/// <summary>
/// The recipient is a primary (To) recipient. Clients are required to handle primary recipients. All other types are optional.
/// </summary>
To = 0x0001,
/// <summary>
/// The recipient is a carbon copy (CC) recipient, a recipient that receives a message in addition to the primary recipients.
/// </summary>
Cc = 0x0002,
/// <summary>
/// The recipient is a blind carbon copy (BCC) recipient. Primary and carbon copy recipients are unaware of the existence of BCC recipients.
/// </summary>
Bcc = 0x0003,
/// <summary>
/// The recipient is a resource (e.g. a room)
/// </summary>
Resource = 0x0004,
/// <summary>
/// The recipient is a room (uses PR_RECIPIENT_TYPE_EXE) needs Exchange 2007 or higher
/// </summary>
Room = 0x0007
}
================================================
FILE: MsgKit/Enums/RecurrencePatternCalendarType.cs
================================================
//
// RecurrencePatternCalendarType.cs
//
// Author: Kees van Spelde <sicos2002@hotmail.com>
//
// Copyright (c) 2013-2026 Kees van Spelde. (www.magic-sessions.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ReSharper disable InconsistentNaming
namespace MsgKit.Enums;
/// <summary>
/// An integer that specifies the type of calendar that is used. The acceptable values for the calendar type are listed
/// in the following table.
/// </summary>
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/ee203303(v=exchg.80).aspx
/// </remarks>
public enum RecurrencePatternCalendarType
{
/// <summary>
/// The default value for the calendar type is Gregorian.
/// If the value of the PatternType field is HjMonth, HjMonthNth, or HjMonthEnd and the value of the CalendarType field
/// is Default, this recurrence uses the Hijri calendar.
/// </summary>
Default = 0x0000,
/// <summary>
/// Gregorian (localized) calendar
/// </summary>
CAL_GREGORIAN = 0x0001,
/// <summary>
/// Gregorian (U.S.) calendar
/// </summary>
CAL_GREGORIAN_US = 0x0002,
/// <summary>
/// Japanese Emperor era calendar
/// </summary>
CAL_JAPAN = 0x0003,
/// <summary>
/// Taiwan calendar
/// </summary>
CAL_TAIWAN = 0x0004,
/// <summary>
/// Korean Tangun era calendar
/// </summary>
CAL_KOREA = 0x0005,
/// <summary>
/// Hijri (Arabic Lunar)
gitextract_xbt61gzj/ ├── .gitattributes ├── .github/ │ └── FUNDING.yml ├── .gitignore ├── MsgKit/ │ ├── Address.cs │ ├── Appointment.cs │ ├── Attachments.cs │ ├── Contact.cs │ ├── ContactAssistant.cs │ ├── ContactBusiness.cs │ ├── ContactCommon.cs │ ├── ContactCompanyMain.cs │ ├── ContactHome.cs │ ├── ContactOther.cs │ ├── ContactWork.cs │ ├── ContactYomi.cs │ ├── Converter.cs │ ├── Email.cs │ ├── Enums/ │ │ ├── AddressBookEntryIdType.cs │ │ ├── AddressType.cs │ │ ├── AppointmentState.cs │ │ ├── AttachmentFlags.cs │ │ ├── AttachmentType.cs │ │ ├── MapiAccess.cs │ │ ├── MapiObjectType.cs │ │ ├── MeetingType.cs │ │ ├── MessageClass.cs │ │ ├── MessageEditorFormat.cs │ │ ├── MessageFlags.cs │ │ ├── MessageFormat.cs │ │ ├── MessageIconIndex.cs │ │ ├── MessageImportance.cs │ │ ├── MessagePriority.cs │ │ ├── PostalAddressId.cs │ │ ├── PropertyFlags.cs │ │ ├── PropertyKind.cs │ │ ├── PropertyType.cs │ │ ├── RecipientFlags.cs │ │ ├── RecipientRowAddressType.cs │ │ ├── RecipientRowDisplayType.cs │ │ ├── RecipientType.cs │ │ ├── RecurrencePatternCalendarType.cs │ │ ├── RecurrencePatternFirstDOWDay.cs │ │ ├── RecurrencePatternFrequency.cs │ │ ├── RecurrencePatternPatternType.cs │ │ ├── RecurrencePatternRecurrenceRangeType.cs │ │ ├── StoreSupportMask.cs │ │ ├── TaskAcceptanceState.cs │ │ ├── TaskHistory.cs │ │ ├── TaskMode.cs │ │ ├── TaskMultipleRecipients .cs │ │ ├── TaskOwnership.cs │ │ ├── TaskState.cs │ │ └── TaskStatus.cs │ ├── Exceptions/ │ │ ├── MKAttachment.cs │ │ ├── MKAttachmentExists.cs │ │ ├── MKInvalidProperty.cs │ │ ├── MKMessageSaved.cs │ │ └── MKPropertyNotFound.cs │ ├── Helpers/ │ │ ├── Conversion.cs │ │ ├── Crc32Calculator.cs │ │ ├── EmailAddress.cs │ │ ├── Exception.cs │ │ ├── ExtensionMethods.cs │ │ ├── FileManager.cs │ │ ├── Mapi.cs │ │ ├── MimeType.cs │ │ ├── Stream.cs │ │ └── Strings.cs │ ├── Message.cs │ ├── Mime/ │ │ ├── Decode/ │ │ │ ├── Base64.cs │ │ │ ├── EncodedWord.cs │ │ │ ├── EncodingFinder.cs │ │ │ ├── QuotedPrintable.cs │ │ │ ├── Rfc2231Decoder.cs │ │ │ ├── Rfc2822DateTime.cs │ │ │ ├── SizeParser.cs │ │ │ └── Utility.cs │ │ └── Header/ │ │ ├── ContentTransferEncoding.cs │ │ ├── HeaderExtractor.cs │ │ ├── HeaderFieldParser.cs │ │ ├── MessageHeader.cs │ │ ├── Received.cs │ │ └── RfcMailAddress.cs │ ├── MsgKit.csproj │ ├── MsgKit.snk │ ├── MsgKit.xml │ ├── NamedPropertyMapping.cs │ ├── NamedPropertyTags.cs │ ├── PropertyTags.cs │ ├── Receiving.cs │ ├── ReceivingRepresenting.cs │ ├── Recipient.cs │ ├── Representing.cs │ ├── Rtf/ │ │ ├── Compressor.cs │ │ └── Encapsulator.cs │ ├── Sender.cs │ ├── Streams/ │ │ ├── AttachmentProperties.cs │ │ ├── EmbeddedMessageProperties.cs │ │ ├── EntryStream.cs │ │ ├── GuidStream.cs │ │ ├── NamedProperties.cs │ │ ├── RecipientProperties.cs │ │ ├── StringStream.cs │ │ └── TopLevelProperties.cs │ ├── Structures/ │ │ ├── AddressBookEntryId.cs │ │ ├── CLSID.cs │ │ ├── NamedProperty.cs │ │ ├── OneOffEntryId.cs │ │ ├── Properties.cs │ │ ├── Property.cs │ │ ├── RecipientRow.cs │ │ ├── RecurrencePattern.cs │ │ ├── ReportTag.cs │ │ └── UnsendableRecipients.cs │ ├── Task.cs │ ├── ThreadIndex.cs │ ├── TranslateTags.cs │ ├── app.config │ └── packages.config ├── MsgKit.sln ├── MsgKit.sln.DotSettings ├── MsgKitTestTool/ │ ├── EmailForm.Designer.cs │ ├── EmailForm.cs │ ├── EmailForm.resx │ ├── MsgKitTestTool.csproj │ ├── Program.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── Tests.cs │ ├── app.config │ └── packages.config └── README.md
SYMBOL INDEX (372 symbols across 117 files)
FILE: MsgKit/Address.cs
class Address (line 37) | public class Address
method Address (line 126) | public Address(string email,
FILE: MsgKit/Appointment.cs
class Appointment (line 41) | public class Appointment : Email
method Appointment (line 79) | public Appointment(Sender sender,
method Appointment (line 92) | public Appointment(Sender sender,
method WriteToStorage (line 104) | private new void WriteToStorage()
method Save (line 121) | public new void Save(Stream stream)
method Save (line 131) | public new void Save(string fileName)
FILE: MsgKit/Attachments.cs
class Attachments (line 51) | public class Attachments : List<Attachment>
method CheckAttachmentFileName (line 60) | private void CheckAttachmentFileName(string fileName, string contentId)
method WriteToStorage (line 81) | internal long WriteToStorage(Storage rootStorage)
method Add (line 110) | public void Add(string fileName,
method Add (line 146) | public void Add(Stream stream,
method AddContactPhoto (line 178) | internal void AddContactPhoto(Stream stream, string fileName)
method AddLink (line 215) | public void AddLink(FileInfo file,
class Attachment (line 235) | public class Attachment
method Attachment (line 311) | internal Attachment(Stream stream,
method Attachment (line 349) | internal Attachment(FileInfo file,
method GetShortFileName (line 379) | private static string GetShortFileName(string fileName)
method WriteProperties (line 406) | internal long WriteProperties(Storage storage, int index)
FILE: MsgKit/Contact.cs
class Contact (line 41) | public class Contact : Email
method Contact (line 297) | public Contact(
method Contact (line 313) | public Contact(
method WriteToStorage (line 327) | private new void WriteToStorage()
method Save (line 674) | public new void Save(Stream stream)
method Save (line 684) | public new void Save(string fileName)
FILE: MsgKit/ContactAssistant.cs
class ContactAssistant (line 34) | public class ContactAssistant
FILE: MsgKit/ContactBusiness.cs
class ContactBusiness (line 34) | public class ContactBusiness : ContactOther
FILE: MsgKit/ContactCommon.cs
class ContactCommon (line 34) | public class ContactCommon
FILE: MsgKit/ContactCompanyMain.cs
class ContactCompanyMain (line 34) | public class ContactCompanyMain : ContactAssistant
FILE: MsgKit/ContactHome.cs
class ContactHome (line 33) | public class ContactHome : ContactOther
FILE: MsgKit/ContactOther.cs
class ContactOther (line 34) | public class ContactOther : ContactCommon
FILE: MsgKit/ContactWork.cs
class ContactWork (line 34) | public class ContactWork : ContactCommon
FILE: MsgKit/ContactYomi.cs
class ContactYomi (line 34) | public class ContactYomi
FILE: MsgKit/Converter.cs
class Converter (line 44) | public static class Converter
method ConvertEmlToMsg (line 52) | public static void ConvertEmlToMsg(string emlFileName, string msgFileN...
method ConvertEmlToMsg (line 64) | public static void ConvertEmlToMsg(Stream emlFile, Stream msgFile)
method ConvertMsgToEml (line 251) | public static void ConvertMsgToEml(string msgFileName, string emlFileN...
method ConvertMsgToEml (line 263) | public static void ConvertMsgToEml(Stream msgFile, Stream emlFile)
method ReadUnicodeString (line 404) | private static string ReadUnicodeString(Storage storage, PropertyTags....
method ReadBinaryProperty (line 422) | private static byte[] ReadBinaryProperty(Storage storage, PropertyTags...
FILE: MsgKit/Email.cs
class Email (line 55) | public class Email : Message, IDisposable
method Email (line 299) | public Email(Sender sender,
method Email (line 324) | public Email(Sender sender,
method SetSubject (line 360) | protected void SetSubject()
method WriteToStorage (line 401) | internal void WriteToStorage()
method Save (line 593) | public new void Save(Stream stream)
method Save (line 603) | public new void Save(string fileName)
method Dispose (line 614) | public new void Dispose()
FILE: MsgKit/Enums/AddressBookEntryIdType.cs
type AddressBookEntryIdType (line 32) | public enum AddressBookEntryIdType
FILE: MsgKit/Enums/AddressType.cs
type AddressType (line 32) | public enum AddressType
FILE: MsgKit/Enums/AppointmentState.cs
type AppointmentState (line 37) | public enum AppointmentState : uint
FILE: MsgKit/Enums/AttachmentFlags.cs
type AttachmentFlags (line 37) | public enum AttachmentFlags : uint
FILE: MsgKit/Enums/AttachmentType.cs
type AttachmentType (line 37) | public enum AttachmentType : uint
FILE: MsgKit/Enums/MapiAccess.cs
type MapiAccess (line 40) | [Flags]
FILE: MsgKit/Enums/MapiObjectType.cs
type MapiObjectType (line 43) | [Flags]
FILE: MsgKit/Enums/MeetingType.cs
type MeetingType (line 37) | public enum MeetingType : uint
FILE: MsgKit/Enums/MessageClass.cs
type MessageClass (line 37) | public enum MessageClass
FILE: MsgKit/Enums/MessageEditorFormat.cs
type MessageEditorFormat (line 37) | public enum MessageEditorFormat
FILE: MsgKit/Enums/MessageFlags.cs
type MessageFlags (line 47) | [Flags]
FILE: MsgKit/Enums/MessageFormat.cs
type MessageFormat (line 32) | public enum MessageFormat
FILE: MsgKit/Enums/MessageIconIndex.cs
type MessageIconIndex (line 38) | [Flags]
FILE: MsgKit/Enums/MessageImportance.cs
type MessageImportance (line 37) | public enum MessageImportance
FILE: MsgKit/Enums/MessagePriority.cs
type MessagePriority (line 37) | public enum MessagePriority
FILE: MsgKit/Enums/PostalAddressId.cs
type PostalAddressId (line 37) | public enum PostalAddressId : uint
FILE: MsgKit/Enums/PropertyFlags.cs
type PropertyFlags (line 37) | [Flags]
FILE: MsgKit/Enums/PropertyKind.cs
type PropertyKind (line 34) | [Flags]
FILE: MsgKit/Enums/PropertyType.cs
type PropertyType (line 34) | public enum PropertyType : ushort
FILE: MsgKit/Enums/RecipientFlags.cs
type RecipientFlags (line 37) | [Flags]
FILE: MsgKit/Enums/RecipientRowAddressType.cs
type RecipientRowAddressType (line 34) | public enum RecipientRowAddressType
FILE: MsgKit/Enums/RecipientRowDisplayType.cs
type RecipientRowDisplayType (line 30) | public enum RecipientRowDisplayType
FILE: MsgKit/Enums/RecipientType.cs
type RecipientType (line 30) | public enum RecipientType : uint
FILE: MsgKit/Enums/RecurrencePatternCalendarType.cs
type RecurrencePatternCalendarType (line 38) | public enum RecurrencePatternCalendarType
FILE: MsgKit/Enums/RecurrencePatternFirstDOWDay.cs
type RecurrencePatternFirstDOWDay (line 38) | public enum RecurrencePatternFirstDOWDay
FILE: MsgKit/Enums/RecurrencePatternFrequency.cs
type RecurrencePatternFrequency (line 36) | public enum RecurrencePatternFrequency
FILE: MsgKit/Enums/RecurrencePatternPatternType.cs
type RecurrencePatternPatternType (line 36) | public enum RecurrencePatternPatternType
FILE: MsgKit/Enums/RecurrencePatternRecurrenceRangeType.cs
type RecurrencePatternRecurrenceRangeType (line 36) | public enum RecurrencePatternRecurrenceRangeType
FILE: MsgKit/Enums/StoreSupportMask.cs
class StoreSupportMaskConst (line 28) | internal class StoreSupportMaskConst
type StoreSupportMask (line 48) | [Flags]
FILE: MsgKit/Enums/TaskAcceptanceState.cs
type TaskAcceptanceState (line 37) | public enum TaskAcceptanceState : uint
FILE: MsgKit/Enums/TaskHistory.cs
type TaskHistory (line 37) | public enum TaskHistory : uint
FILE: MsgKit/Enums/TaskMode.cs
type TaskMode (line 37) | public enum TaskMode : uint
FILE: MsgKit/Enums/TaskMultipleRecipients .cs
type TaskMultipleRecipients (line 37) | public enum TaskMultipleRecipients : uint
FILE: MsgKit/Enums/TaskOwnership.cs
type TaskOwnership (line 37) | public enum TaskOwnership : uint
FILE: MsgKit/Enums/TaskState.cs
type TaskState (line 37) | public enum TaskState : uint
FILE: MsgKit/Enums/TaskStatus.cs
type TaskStatus (line 37) | public enum TaskStatus : uint
FILE: MsgKit/Exceptions/MKAttachment.cs
class MKAttachment (line 34) | public class MKAttachment : Exception
method MKAttachment (line 36) | internal MKAttachment()
method MKAttachment (line 40) | internal MKAttachment(string message) : base(message)
method MKAttachment (line 44) | internal MKAttachment(string message, Exception inner) : base(message,...
FILE: MsgKit/Exceptions/MKAttachmentExists.cs
class MKAttachmentExists (line 34) | public class MKAttachmentExists : Exception
method MKAttachmentExists (line 36) | internal MKAttachmentExists()
method MKAttachmentExists (line 40) | internal MKAttachmentExists(string message) : base(message)
method MKAttachmentExists (line 44) | internal MKAttachmentExists(string message, Exception inner) : base(me...
FILE: MsgKit/Exceptions/MKInvalidProperty.cs
class MKInvalidProperty (line 34) | public class MKInvalidProperty : Exception
method MKInvalidProperty (line 36) | internal MKInvalidProperty()
method MKInvalidProperty (line 40) | internal MKInvalidProperty(string message) : base(message)
method MKInvalidProperty (line 44) | internal MKInvalidProperty(string message, Exception inner) : base(mes...
FILE: MsgKit/Exceptions/MKMessageSaved.cs
class MKMessageSaved (line 34) | public class MKMessageSaved : Exception
method MKMessageSaved (line 36) | internal MKMessageSaved()
method MKMessageSaved (line 40) | internal MKMessageSaved(string message) : base(message)
method MKMessageSaved (line 44) | internal MKMessageSaved(string message, Exception inner) : base(messag...
FILE: MsgKit/Exceptions/MKPropertyNotFound.cs
class MKPropertyNotFound (line 34) | public class MKPropertyNotFound : Exception
method MKPropertyNotFound (line 36) | internal MKPropertyNotFound()
method MKPropertyNotFound (line 40) | internal MKPropertyNotFound(string message) : base(message)
method MKPropertyNotFound (line 44) | internal MKPropertyNotFound(string message, Exception inner) : base(me...
FILE: MsgKit/Helpers/Conversion.cs
class Conversion (line 36) | internal static class Conversion
method ObjectToByteArray (line 44) | public static byte[] ObjectToByteArray(Object obj)
method ByteArrayToObject (line 64) | public static Object ByteArrayToObject(byte[] array)
FILE: MsgKit/Helpers/Crc32Calculator.cs
class Crc32Calculator (line 33) | internal class Crc32Calculator
method CalculateCrc32 (line 94) | public static uint CalculateCrc32(byte[] buffer)
FILE: MsgKit/Helpers/EmailAddress.cs
class EmailAddress (line 34) | internal static class EmailAddress
method IsEmailAddressValid (line 42) | public static bool IsEmailAddressValid(string emailAddress)
method RemoveSingleQuotes (line 60) | public static string RemoveSingleQuotes(string email)
FILE: MsgKit/Helpers/Exception.cs
class Exception (line 34) | internal static class Exception
method GetInnerException (line 42) | public static string GetInnerException(System.Exception e)
FILE: MsgKit/Helpers/ExtensionMethods.cs
class ExtensionMethods (line 5) | internal static class ExtensionMethods
method GetStorage (line 13) | internal static Storage GetStorage(this Storage storage, string name)
method GetStream (line 24) | internal static CfbStream GetStream(this Storage storage, string name)
FILE: MsgKit/Helpers/FileManager.cs
class FileManager (line 37) | internal static class FileManager
method CheckForDirectorySeparator (line 57) | public static string CheckForDirectorySeparator(string line)
method FileExistsMakeNew (line 78) | public static string FileExistsMakeNew(string fileName, bool validateL...
method RemoveInvalidFileNameChars (line 114) | public static string RemoveInvalidFileNameChars(string fileName)
method ValidateLongFileName (line 139) | public static string ValidateLongFileName(string fileName, int extraTr...
method GetExtension (line 180) | public static string GetExtension(string path)
method GetFileNameWithoutExtension (line 203) | public static string GetFileNameWithoutExtension(string path)
method GetDirectoryName (line 222) | public static string GetDirectoryName(string path)
FILE: MsgKit/Helpers/Mapi.cs
class Mapi (line 35) | internal static class Mapi
method GenerateSearchKey (line 61) | public static byte[] GenerateSearchKey(string addressType, string emai...
method GenerateRecordKey (line 84) | public static byte[] GenerateRecordKey()
method GenerateInstanceKey (line 100) | public static byte[] GenerateInstanceKey()
method GenerateEntryId (line 128) | public static byte[] GenerateEntryId()
FILE: MsgKit/Helpers/MimeType.cs
class MimeTypes (line 12) | public static class MimeTypes
method MimeTypes (line 23) | static MimeTypes()
method GetMimeType (line 594) | public static string GetMimeType(string fileName)
FILE: MsgKit/Helpers/Stream.cs
class StreamUtility (line 36) | internal static class StreamUtility
method ToByteArray (line 44) | internal static byte[] ToByteArray(this Stream input)
method Eos (line 60) | internal static bool Eos(this BinaryReader binaryReader)
method ReadLineAsBytes (line 82) | public static byte[] ReadLineAsBytes(Stream stream)
method ReadLineAsAscii (line 123) | public static string ReadLineAsAscii(Stream stream)
FILE: MsgKit/Helpers/Strings.cs
class Strings (line 37) | internal static class Strings
method ReadNullTerminatedString (line 46) | public static string ReadNullTerminatedString(BinaryReader binaryReade...
method ReadNullTerminatedAsciiString (line 60) | public static string ReadNullTerminatedAsciiString(BinaryReader binary...
method ReadNullTerminatedUnicodeString (line 81) | public static string ReadNullTerminatedUnicodeString(BinaryReader bina...
method WriteNullTerminatedString (line 104) | public static void WriteNullTerminatedString(BinaryWriter binaryWriter,
method WriteNullTerminatedAsciiString (line 121) | public static void WriteNullTerminatedAsciiString(BinaryWriter binaryW...
method WriteNullTerminatedUnicodeString (line 136) | public static void WriteNullTerminatedUnicodeString(BinaryWriter binar...
FILE: MsgKit/Message.cs
class Message (line 45) | public class Message : IDisposable
method Message (line 161) | internal Message()
method Save (line 183) | private void Save()
method Save (line 195) | internal void Save(string fileName)
method Save (line 206) | internal void Save(Stream stream)
method AddProperty (line 226) | public void AddProperty(PropertyTags.PropertyTag property, object valu...
method AddProperty (line 242) | public void AddProperty(NamedPropertyTag namedProperty, object value)
method Dispose (line 255) | public void Dispose()
FILE: MsgKit/Mime/Decode/Base64.cs
class Base64 (line 11) | internal static class Base64
method Decode (line 19) | public static byte[] Decode(string base64Encoded)
method Decode (line 71) | public static string Decode(string base64Encoded, Encoding encoding)
FILE: MsgKit/Mime/Decode/EncodedWord.cs
class EncodedWord (line 24) | internal static class EncodedWord
method Decode (line 51) | public static string Decode(string encodedWords)
FILE: MsgKit/Mime/Decode/EncodingFinder.cs
class EncodingFinder (line 36) | public static class EncodingFinder
method EncodingFinder (line 42) | static EncodingFinder()
method Reset (line 52) | internal static void Reset()
method FindEncoding (line 70) | internal static Encoding FindEncoding(string characterSet)
method AddMapping (line 129) | public static void AddMapping(string characterSet, Encoding encoding)
FILE: MsgKit/Mime/Decode/QuotedPrintable.cs
class QuotedPrintable (line 15) | internal static class QuotedPrintable
method DecodeEncodedWord (line 29) | public static string DecodeEncodedWord(string toDecode, Encoding encod...
method DecodeContentTransferEncoding (line 50) | public static byte[] DecodeContentTransferEncoding(string toDecode)
method Rfc2047QuotedPrintableDecode (line 75) | private static byte[] Rfc2047QuotedPrintableDecode(string toDecode, bo...
method WriteAllBytesToStream (line 134) | private static void WriteAllBytesToStream(Stream stream, byte[] toWrite)
method RemoveIllegalControlCharacters (line 156) | private static string RemoveIllegalControlCharacters(string input)
method RemoveCarriageReturnAndNewLinewIfNotInPair (line 180) | private static string RemoveCarriageReturnAndNewLinewIfNotInPair(strin...
method DecodeEqualSignNotLongEnough (line 247) | private static byte[] DecodeEqualSignNotLongEnough(string decode)
method DecodeEqualSign (line 281) | private static byte[] DecodeEqualSign(string decode)
FILE: MsgKit/Mime/Decode/Rfc2231Decoder.cs
class Rfc2231Decoder (line 68) | internal static class Rfc2231Decoder
method Decode (line 90) | public static List<KeyValuePair<string, string>> Decode(string toDecode)
method DecodePairs (line 154) | private static List<KeyValuePair<string, string>> DecodePairs(IList<Ke...
method DecodeSingleValue (line 295) | private static string DecodeSingleValue(string toDecode, out string en...
method DecodeSingleValue (line 324) | private static string DecodeSingleValue(string valueToDecode, string e...
FILE: MsgKit/Mime/Decode/Rfc2822DateTime.cs
class Rfc2822DateTime (line 10) | internal static class Rfc2822DateTime
method StringToDate (line 36) | public static DateTime StringToDate(string inputDate)
method AdjustTimezone (line 86) | private static DateTime AdjustTimezone(DateTime dateTime, string dateI...
method MatchEvaluator (line 151) | private static string MatchEvaluator(Match match)
method ExtractDateTime (line 284) | private static DateTime ExtractDateTime(string dateInput)
method StripCommentsAndExcessWhitespace (line 368) | private static string StripCommentsAndExcessWhitespace(string input)
method FixSpecialCases (line 403) | private static string FixSpecialCases(string inputDate)
FILE: MsgKit/Mime/Decode/SizeParser.cs
class SizeParser (line 12) | internal static class SizeParser
method InitializeSizes (line 19) | private static Dictionary<string, long> InitializeSizes()
method Parse (line 34) | public static long Parse(string value)
method ExtractUnit (line 50) | private static string ExtractUnit(string sizeWithUnit)
method IsDigit (line 66) | private static bool IsDigit(char value)
method MultiplicatorForUnit (line 74) | private static long MultiplicatorForUnit(string unit)
FILE: MsgKit/Mime/Decode/Utility.cs
class Utility (line 9) | internal static class Utility
method RemoveQuotesIfAny (line 18) | public static string RemoveQuotesIfAny(string text)
method SplitStringWithCharNotInsideQuotes (line 40) | public static List<string> SplitStringWithCharNotInsideQuotes(string i...
FILE: MsgKit/Mime/Header/ContentTransferEncoding.cs
type ContentTransferEncoding (line 9) | public enum ContentTransferEncoding
FILE: MsgKit/Mime/Header/HeaderExtractor.cs
class HeaderExtractor (line 12) | public static class HeaderExtractor
method GetHeaders (line 20) | public static MessageHeader GetHeaders(string headersString)
method ExtractHeaders (line 34) | private static Dictionary<string, List<string>> ExtractHeaders(string ...
method IsMoreLinesInHeaderValue (line 92) | private static bool IsMoreLinesInHeaderValue(TextReader reader)
method SeparateHeaderNameAndValue (line 112) | private static KeyValuePair<string, string> SeparateHeaderNameAndValue...
FILE: MsgKit/Mime/Header/HeaderFieldParser.cs
class HeaderFieldParser (line 13) | internal static class HeaderFieldParser
method ParseContentTransferEncoding (line 26) | public static ContentTransferEncoding ParseContentTransferEncoding(str...
method ParseImportance (line 64) | public static MailPriority ParseImportance(string headerValue)
method ParseContentType (line 97) | public static ContentType ParseContentType(string headerValue)
method ParseContentDisposition (line 165) | public static ContentDisposition ParseContentDisposition(string header...
method ParseId (line 250) | public static string ParseId(string headerValue)
method ParseMultipleIDs (line 265) | public static List<string> ParseMultipleIDs(string headerValue)
FILE: MsgKit/Mime/Header/MessageHeader.cs
class MessageHeader (line 20) | public sealed class MessageHeader
method MessageHeader (line 238) | public MessageHeader()
method MessageHeader (line 249) | internal MessageHeader(Dictionary<string, List<string>> rawHeaders)
method Clear (line 267) | private void Clear()
method ParseHeaders (line 299) | private void ParseHeaders(Dictionary<string, List<string>> headers)
method ParseHeader (line 325) | private void ParseHeader(string headerName, string headerValue)
method HeaderValue (line 489) | public string HeaderValue(string headerName)
method SetHeaderValue (line 501) | public void SetHeaderValue(string headerName, string headerValue)
method ToString (line 517) | public override string ToString()
FILE: MsgKit/Mime/Header/Received.cs
class Received (line 17) | public class Received
method Received (line 27) | public Received(string headerValue)
method ParseDictionary (line 53) | private static Dictionary<string, string> ParseDictionary(string heade...
FILE: MsgKit/Mime/Header/RfcMailAddress.cs
class RfcMailAddress (line 19) | public class RfcMailAddress
method ToString (line 26) | public override string ToString()
method RfcMailAddress (line 98) | private RfcMailAddress(MailAddress mailAddress, string raw)
method RfcMailAddress (line 112) | private RfcMailAddress(string raw)
method ParseMailAddress (line 141) | internal static RfcMailAddress ParseMailAddress(string input)
method ParseMailAddresses (line 223) | internal static List<RfcMailAddress> ParseMailAddresses(string input)
FILE: MsgKit/NamedPropertyMapping.cs
class NamedPropertyMapping (line 36) | internal class NamedPropertyMapping
FILE: MsgKit/NamedPropertyTags.cs
class NamedPropertyTags (line 43) | public static class NamedPropertyTags
class NamedPropertyTag (line 5333) | public class NamedPropertyTag
method NamedPropertyTag (line 5365) | public NamedPropertyTag(ushort id, string name, Guid guid, PropertyTyp...
FILE: MsgKit/PropertyTags.cs
class PropertyTags (line 40) | public static class PropertyTags
class PropertyTag (line 4924) | public class PropertyTag
method PropertyTag (line 4953) | internal PropertyTag(ushort id, PropertyType type)
FILE: MsgKit/Receiving.cs
class Receiving (line 41) | public class Receiving : Address
method Receiving (line 50) | public Receiving(string email, string displayName, AddressType address...
method WriteProperties (line 66) | internal void WriteProperties(TopLevelProperties propertiesStream)
FILE: MsgKit/ReceivingRepresenting.cs
class ReceivingRepresenting (line 42) | public class ReceivingRepresenting : Address
method ReceivingRepresenting (line 51) | public ReceivingRepresenting(string email, string displayName, Address...
method WriteProperties (line 67) | internal void WriteProperties(TopLevelProperties propertiesStream)
FILE: MsgKit/Recipient.cs
class Recipients (line 39) | public class Recipients : List<Recipient>
method AddTo (line 50) | public void AddTo(string email,
method AddCc (line 74) | public void AddCc(string email,
method AddBcc (line 97) | public void AddBcc(string email,
method AddRecipient (line 121) | public void AddRecipient(string email,
method WriteToStorage (line 147) | internal long WriteToStorage(Storage rootStorage)
class Recipient (line 166) | public class Recipient : Address
method Recipient (line 207) | internal Recipient(long rowId,
method WriteProperties (line 239) | internal long WriteProperties(Storage storage)
FILE: MsgKit/Representing.cs
class Representing (line 43) | public class Representing : Address
method Representing (line 52) | public Representing(string email, string displayName, AddressType addr...
method WriteProperties (line 68) | internal void WriteProperties(TopLevelProperties propertiesStream)
FILE: MsgKit/Rtf/Compressor.cs
class Compressor (line 38) | internal class Compressor
class CompressionPositions (line 44) | internal class CompressionPositions
method Compressor (line 63) | internal Compressor()
method FindLongestMatch (line 84) | internal CompressionPositions FindLongestMatch(byte[] initialDictionar...
method Compress (line 137) | internal byte[] Compress(byte[] data)
FILE: MsgKit/Rtf/Encapsulator.cs
class Encapsulator (line 11) | internal static class Encapsulator
method Encapsulate (line 18) | internal static string Encapsulate(string html)
FILE: MsgKit/Sender.cs
class Sender (line 40) | public class Sender : Address
method Sender (line 71) | public Sender(string email,
method WriteProperties (line 95) | internal void WriteProperties(TopLevelProperties propertiesStream)
FILE: MsgKit/Streams/AttachmentProperties.cs
class AttachmentProperties (line 36) | internal sealed class AttachmentProperties : Properties
method AttachmentProperties (line 42) | internal AttachmentProperties()
method AttachmentProperties (line 51) | internal AttachmentProperties(CfbStream stream)
method WriteProperties (line 73) | internal long WriteProperties(Storage storage)
FILE: MsgKit/Streams/EmbeddedMessageProperties.cs
class EmbeddedMessageProperties (line 37) | internal sealed class EmbeddedMessageProperties : Properties
method EmbeddedMessageProperties (line 75) | internal EmbeddedMessageProperties(int nextRecipientId,
method EmbeddedMessageProperties (line 91) | internal EmbeddedMessageProperties(CfbStream stream)
method WriteProperties (line 117) | internal long WriteProperties(Storage storage)
FILE: MsgKit/Streams/EntryStream.cs
class EntryStream (line 50) | internal sealed class EntryStream : List<EntryStreamItem>
method EntryStream (line 56) | internal EntryStream()
method EntryStream (line 65) | internal EntryStream(Storage storage)
method Write (line 83) | internal void Write(Storage storage)
method Write (line 91) | internal void Write(Storage storage, string streamName)
class EntryStreamItem (line 104) | internal sealed class EntryStreamItem
method EntryStreamItem (line 133) | internal EntryStreamItem(BinaryReader binaryReader)
method EntryStreamItem (line 145) | internal EntryStreamItem(ushort nameIdentifierOrStringOffset,
method Write (line 159) | internal void Write(BinaryWriter binaryWriter)
class IndexAndKindInformation (line 174) | internal sealed class IndexAndKindInformation
method GetUIntFromBitArray (line 210) | private static uint GetUIntFromBitArray(BitArray bitArray, int offset,...
method IndexAndKindInformation (line 229) | internal IndexAndKindInformation(BinaryReader binaryReader)
method IndexAndKindInformation (line 243) | internal IndexAndKindInformation(ushort propertyIndex, ushort guidInde...
method Write (line 256) | internal void Write(BinaryWriter binaryWriter)
FILE: MsgKit/Streams/GuidStream.cs
class GuidStream (line 18) | internal sealed class GuidStream : List<Guid>
method GuidStream (line 24) | internal GuidStream()
method GuidStream (line 33) | internal GuidStream(Storage storage)
method Write (line 51) | internal void Write(Storage storage)
FILE: MsgKit/Streams/NamedProperties.cs
class NamedProperties (line 37) | internal sealed class NamedProperties : List<NamedProperty>
method NamedProperties (line 58) | public NamedProperties(TopLevelProperties topLevelProperties)
method AddProperty (line 73) | internal void AddProperty(NamedPropertyTag mapiTag, object obj)
method WriteProperties (line 95) | internal void WriteProperties(Storage storage)
method GenerateStreamString (line 140) | private string GenerateStreamString(uint nameIdentifier, uint guidTarg...
FILE: MsgKit/Streams/RecipientProperties.cs
class RecipientProperties (line 31) | internal sealed class RecipientProperties : Properties
method RecipientProperties (line 37) | internal RecipientProperties()
method RecipientProperties (line 46) | internal RecipientProperties(CfbStream stream)
method WriteProperties (line 68) | internal long WriteProperties(Storage storage)
FILE: MsgKit/Streams/StringStream.cs
class StringStream (line 20) | internal sealed class StringStream : List<StringStreamItem>
method StringStream (line 26) | internal StringStream()
method StringStream (line 35) | internal StringStream(Storage storage)
method Write (line 53) | internal void Write(Storage storage)
class StringStreamItem (line 66) | internal sealed class StringStreamItem
method StringStreamItem (line 89) | internal StringStreamItem(BinaryReader binaryReader)
method StringStreamItem (line 101) | internal StringStreamItem(string name)
method Write (line 113) | internal void Write(BinaryWriter binaryWriter)
method Get4BytesBoundary (line 130) | private static uint Get4BytesBoundary(uint length)
FILE: MsgKit/Streams/TopLevelProperties.cs
class TopLevelProperties (line 37) | internal sealed class TopLevelProperties : Properties
method TopLevelProperties (line 67) | internal TopLevelProperties(CfbStream stream)
method TopLevelProperties (line 82) | internal TopLevelProperties()
method WriteProperties (line 102) | internal long WriteProperties(Storage storage, long? messageSize = null)
FILE: MsgKit/Structures/AddressBookEntryId.cs
class AddressBookEntryId (line 39) | public class AddressBookEntryId
method AddressBookEntryId (line 60) | internal AddressBookEntryId(BinaryReader binaryReader)
FILE: MsgKit/Structures/CLSID.cs
class CLSID (line 38) | internal class CLSID
method CLSID (line 67) | internal CLSID(BinaryReader binaryReader)
method ToGuid (line 81) | public Guid ToGuid()
FILE: MsgKit/Structures/NamedProperty.cs
class NamedProperty (line 38) | internal class NamedProperty
FILE: MsgKit/Structures/OneOffEntryId.cs
class OneOffEntryId (line 45) | internal class OneOffEntryId : Address
method OneOffEntryId (line 69) | public OneOffEntryId(string email,
method ToByteArray (line 84) | internal byte[] ToByteArray()
FILE: MsgKit/Structures/Properties.cs
class Properties (line 43) | internal class Properties : List<Property>
method ReadProperties (line 50) | internal void ReadProperties(BinaryReader binaryReader)
method WriteProperties (line 85) | internal long WriteProperties(OpenMcdf.Storage storage, BinaryWriter b...
method AddProperty (line 257) | internal void AddProperty(PropertyTags.PropertyTag mapiTag,
method AddOrReplaceProperty (line 293) | internal void AddOrReplaceProperty(PropertyTags.PropertyTag mapiTag,
method MultiValue (line 313) | private byte[] MultiValue<T>(PropertyType type, object obj)
method AddMultiValueStreams (line 363) | private void AddMultiValueStreams<T>(PropertyTags.PropertyTag mapiTag,...
method AsBytes (line 391) | private byte[] AsBytes(PropertyType type, object obj)
method GetSingleTypeFromMultiValueType (line 573) | private PropertyType GetSingleTypeFromMultiValueType(PropertyType mult...
method NullTerminator (line 588) | private byte[] NullTerminator(PropertyType type)
FILE: MsgKit/Structures/Property.cs
class Property (line 43) | public class Property
method GetPropertyId (line 425) | private static string GetPropertyId(ushort id, PropertyType type, int ...
method ByteArrayToDecimal (line 438) | private static decimal ByteArrayToDecimal(byte[] source, int offset)
method Property (line 457) | internal Property(ushort id, PropertyType type, byte[] data, int multi...
method Property (line 473) | internal Property(ushort id, PropertyType type, PropertyFlags flags, b...
method Property (line 490) | internal Property(ushort id, PropertyType type, uint flags, byte[] dat...
FILE: MsgKit/Structures/RecipientRow.cs
class RecipientRow (line 48) | public class RecipientRow
method RecipientRow (line 196) | internal RecipientRow(BinaryReader binaryReader,
FILE: MsgKit/Structures/RecurrencePattern.cs
class RecurrencePattern (line 42) | public class RecurrencePattern
method ToByteArray (line 120) | internal byte[] ToByteArray()
FILE: MsgKit/Structures/ReportTag.cs
class ReportTag (line 44) | internal class ReportTag
method ToByteArray (line 136) | internal byte[] ToByteArray()
FILE: MsgKit/Structures/UnsendableRecipients.cs
class UnsendableRecipients (line 39) | public class UnsendableRecipients : List<RecipientRow>
method UnsendableRecipients (line 94) | internal UnsendableRecipients(byte[] data)
FILE: MsgKit/Task.cs
class Task (line 40) | public class Task : Email
method Task (line 248) | public Task(Sender sender,
method Task (line 261) | public Task(Sender sender,
method WriteToStorage (line 273) | private new void WriteToStorage()
method Save (line 364) | public new void Save(Stream stream)
method Save (line 374) | public new void Save(string fileName)
FILE: MsgKit/ThreadIndex.cs
class ThreadIndex (line 9) | public class ThreadIndex
method ThreadIndex (line 41) | public ThreadIndex(string threadIndex)
method ToString (line 82) | public override string ToString()
FILE: MsgKit/TranslateTags.cs
class TranslateTags (line 42) | internal static class TranslateTags
method TranslateTags (line 50) | static TranslateTags()
method PropertyNameToCanonical (line 1089) | internal static string PropertyNameToCanonical(string propertyName)
method CanonicalToPropertyName (line 1108) | internal static string CanonicalToPropertyName(string canonicalName)
FILE: MsgKitTestTool/EmailForm.Designer.cs
class MainForm (line 3) | partial class MainForm
method Dispose (line 14) | protected override void Dispose(bool disposing)
method InitializeComponent (line 29) | private void InitializeComponent()
FILE: MsgKitTestTool/EmailForm.cs
class MainForm (line 37) | public partial class MainForm : Form
method MainForm (line 39) | public MainForm()
method button1_Click (line 44) | private void button1_Click(object sender, EventArgs e)
method Eml2MsgButton_Click (line 84) | private void Eml2MsgButton_Click(object sender, EventArgs e)
method ReadMsgFileButton_Click (line 108) | private void ReadMsgFileButton_Click(object sender, EventArgs e)
method ContactButton_Click (line 130) | private void ContactButton_Click(object sender, EventArgs e)
method button2_Click (line 268) | private void button2_Click(object sender, EventArgs e)
FILE: MsgKitTestTool/Program.cs
class Program (line 32) | static class Program
method Main (line 37) | [STAThread]
FILE: MsgKitTestTool/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: MsgKitTestTool/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: MsgKitTestTool/Tests.cs
class Tests (line 5) | public class Tests
method CreateAppointment (line 7) | public void CreateAppointment()
Condensed preview — 135 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,728K chars).
[
{
"path": ".gitattributes",
"chars": 2518,
"preview": "###############################################################################\n# Set default behavior to automatically "
},
{
"path": ".github/FUNDING.yml",
"chars": 67,
"preview": "# These are supported funding model platforms\n\ngithub: [Sicos1977]\n"
},
{
"path": ".gitignore",
"chars": 3244,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
},
{
"path": "MsgKit/Address.cs",
"chars": 4472,
"preview": "//\n// Address.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. ("
},
{
"path": "MsgKit/Appointment.cs",
"chars": 5223,
"preview": "//\n// Appointment.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 2013-2"
},
{
"path": "MsgKit/Attachments.cs",
"chars": 20370,
"preview": "//\n// Attachments.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Contact.cs",
"chars": 27944,
"preview": "//\n// Contact.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 2013-2026 "
},
{
"path": "MsgKit/ContactAssistant.cs",
"chars": 1714,
"preview": "//\n// ContactAssistant.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van "
},
{
"path": "MsgKit/ContactBusiness.cs",
"chars": 1690,
"preview": "//\n// ContactBusiness.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van S"
},
{
"path": "MsgKit/ContactCommon.cs",
"chars": 2127,
"preview": "//\n// ContactCommon.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spe"
},
{
"path": "MsgKit/ContactCompanyMain.cs",
"chars": 1457,
"preview": "//\n// ContactAssistant.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van "
},
{
"path": "MsgKit/ContactHome.cs",
"chars": 1942,
"preview": "//\n// ContactHome.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/ContactOther.cs",
"chars": 1832,
"preview": "//\n// ContactOther.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spel"
},
{
"path": "MsgKit/ContactWork.cs",
"chars": 1974,
"preview": "//\n// ContactWork.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/ContactYomi.cs",
"chars": 1782,
"preview": "//\n// ContactYomi.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Converter.cs",
"chars": 16467,
"preview": "//\n// Converter.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde."
},
{
"path": "MsgKit/Email.cs",
"chars": 26472,
"preview": "//\n// Email.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (ww"
},
{
"path": "MsgKit/Enums/AddressBookEntryIdType.cs",
"chars": 2523,
"preview": "//\n// AddressBookEntryIdType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees"
},
{
"path": "MsgKit/Enums/AddressType.cs",
"chars": 1866,
"preview": "//\n// AddressType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Enums/AppointmentState.cs",
"chars": 2475,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// AppointmentState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>"
},
{
"path": "MsgKit/Enums/AttachmentFlags.cs",
"chars": 2241,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// AttachmentType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n"
},
{
"path": "MsgKit/Enums/AttachmentType.cs",
"chars": 3369,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// AttachmentType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n/"
},
{
"path": "MsgKit/Enums/MapiAccess.cs",
"chars": 2383,
"preview": "//\n// MapiAccess.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde"
},
{
"path": "MsgKit/Enums/MapiObjectType.cs",
"chars": 3029,
"preview": "//\n// MapiObjectType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Sp"
},
{
"path": "MsgKit/Enums/MeetingType.cs",
"chars": 2243,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// MeetingType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n/"
},
{
"path": "MsgKit/Enums/MessageClass.cs",
"chars": 4471,
"preview": "//\n// MessageClass.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Enums/MessageEditorFormat.cs",
"chars": 2113,
"preview": "//\n// MessageEditorFormat.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees v"
},
{
"path": "MsgKit/Enums/MessageFlags.cs",
"chars": 6886,
"preview": "//\n// MessageFlags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spel"
},
{
"path": "MsgKit/Enums/MessageFormat.cs",
"chars": 1665,
"preview": "//\n// MessageFormat.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spe"
},
{
"path": "MsgKit/Enums/MessageIconIndex.cs",
"chars": 8025,
"preview": "//\n// MessageIconIndex.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van "
},
{
"path": "MsgKit/Enums/MessageImportance.cs",
"chars": 1847,
"preview": "//\n// MessageImportance.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van "
},
{
"path": "MsgKit/Enums/MessagePriority.cs",
"chars": 1865,
"preview": "//\n// MessagePriority.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Sp"
},
{
"path": "MsgKit/Enums/PostalAddressId.cs",
"chars": 2081,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// PostalAddressId.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>"
},
{
"path": "MsgKit/Enums/PropertyFlags.cs",
"chars": 2887,
"preview": "//\n// PropertyFlags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spel"
},
{
"path": "MsgKit/Enums/PropertyKind.cs",
"chars": 1831,
"preview": "//\n// PropertyKind.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Enums/PropertyType.cs",
"chars": 7410,
"preview": "//\n// PropertyType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Enums/RecipientFlags.cs",
"chars": 2759,
"preview": "//\n// RecipientFlags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spe"
},
{
"path": "MsgKit/Enums/RecipientRowAddressType.cs",
"chars": 2140,
"preview": "//\n// RecipientRowAddressType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Ke"
},
{
"path": "MsgKit/Enums/RecipientRowDisplayType.cs",
"chars": 2355,
"preview": "//\n// RecipientRowAddressType.cs\n//\n// Author: RecipientRowDisplayType and associated documentation files (the \"Softwar"
},
{
"path": "MsgKit/Enums/RecipientType.cs",
"chars": 2230,
"preview": "//\n// RecipientType.cs\n//\n// Author: RecipientRowDisplayType and associated documentation files (the \"Software\"), to dea"
},
{
"path": "MsgKit/Enums/RecurrencePatternCalendarType.cs",
"chars": 4093,
"preview": "//\n// RecurrencePatternCalendarType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2"
},
{
"path": "MsgKit/Enums/RecurrencePatternFirstDOWDay.cs",
"chars": 2243,
"preview": "//\n// RecurrencePatternFirstDOWDay.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-20"
},
{
"path": "MsgKit/Enums/RecurrencePatternFrequency.cs",
"chars": 1879,
"preview": "//\n// RecurrencePatternFirstDateTimeFrequency.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright "
},
{
"path": "MsgKit/Enums/RecurrencePatternPatternType.cs",
"chars": 2895,
"preview": "//\n// RecurrencePatternPatternType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-20"
},
{
"path": "MsgKit/Enums/RecurrencePatternRecurrenceRangeType.cs",
"chars": 1933,
"preview": "//\n// RecurrencePatternRecurrenceRangeType.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c)"
},
{
"path": "MsgKit/Enums/StoreSupportMask.cs",
"chars": 7460,
"preview": "//\n// RecipientType.cs\n//\n// Author: RecipientRowDisplayType and associated documentation files (the \"Software\"), to dea"
},
{
"path": "MsgKit/Enums/TaskAcceptanceState.cs",
"chars": 2176,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskHistory.cs",
"chars": 2326,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskMode.cs",
"chars": 2313,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskMultipleRecipients .cs",
"chars": 1935,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskOwnership.cs",
"chars": 2001,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskState.cs",
"chars": 2322,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Enums/TaskStatus.cs",
"chars": 2801,
"preview": "// ReSharper disable InconsistentNaming\n\n//\n// TaskAcceptanceState.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail."
},
{
"path": "MsgKit/Exceptions/MKAttachment.cs",
"chars": 1597,
"preview": "//\n// MWAttachment.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spel"
},
{
"path": "MsgKit/Exceptions/MKAttachmentExists.cs",
"chars": 1644,
"preview": "//\n// MWAttachmentExists.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees va"
},
{
"path": "MsgKit/Exceptions/MKInvalidProperty.cs",
"chars": 1617,
"preview": "//\n// MWInvalidProperty.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van"
},
{
"path": "MsgKit/Exceptions/MKMessageSaved.cs",
"chars": 1641,
"preview": "//\n// MKMessageSaved.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Sp"
},
{
"path": "MsgKit/Exceptions/MKPropertyNotFound.cs",
"chars": 1624,
"preview": "//\n// MWPropertyNotFound.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees va"
},
{
"path": "MsgKit/Helpers/Conversion.cs",
"chars": 2610,
"preview": "//\n// Conversion.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde"
},
{
"path": "MsgKit/Helpers/Crc32Calculator.cs",
"chars": 5249,
"preview": "//\n// Crc32Calculator.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 20"
},
{
"path": "MsgKit/Helpers/EmailAddress.cs",
"chars": 2561,
"preview": "//\n// EmailAddress.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spel"
},
{
"path": "MsgKit/Helpers/Exception.cs",
"chars": 1860,
"preview": "//\n// Exception.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde."
},
{
"path": "MsgKit/Helpers/ExtensionMethods.cs",
"chars": 892,
"preview": "using OpenMcdf;\n\nnamespace MsgKit.Helpers;\n\ninternal static class ExtensionMethods\n{\n /// <summary>\n /// Gets"
},
{
"path": "MsgKit/Helpers/FileManager.cs",
"chars": 9348,
"preview": "//\n// FileManager.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Helpers/Mapi.cs",
"chars": 7127,
"preview": "//\n// Mapi.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (www"
},
{
"path": "MsgKit/Helpers/MimeType.cs",
"chars": 30674,
"preview": "using System;\nusing System.Collections.Generic;\n\nnamespace MsgKit.Helpers;\n\n/// <summary>\n/// A mapping of file name ex"
},
{
"path": "MsgKit/Helpers/Stream.cs",
"chars": 4663,
"preview": "//\n// Stream.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (w"
},
{
"path": "MsgKit/Helpers/Strings.cs",
"chars": 4989,
"preview": "//\n// Strings.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. ("
},
{
"path": "MsgKit/Message.cs",
"chars": 10113,
"preview": "//\n// Message.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. ("
},
{
"path": "MsgKit/Mime/Decode/Base64.cs",
"chars": 3326,
"preview": "using System;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace MsgKit.Mime.Decode;\n\n/"
},
{
"path": "MsgKit/Mime/Decode/EncodedWord.cs",
"chars": 6297,
"preview": "using System;\nusing System.Text.RegularExpressions;\n\nnamespace MsgKit.Mime.Decode;\n\n/// <summary>\n/// Utility class"
},
{
"path": "MsgKit/Mime/Decode/EncodingFinder.cs",
"chars": 6695,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\n\nnamespace MsgKit.Mime.D"
},
{
"path": "MsgKit/Mime/Decode/QuotedPrintable.cs",
"chars": 15824,
"preview": "using System;\nusing System.IO;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace MsgKit.Mime.Decode;\n\n"
},
{
"path": "MsgKit/Mime/Decode/Rfc2231Decoder.cs",
"chars": 15725,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace Msg"
},
{
"path": "MsgKit/Mime/Decode/Rfc2822DateTime.cs",
"chars": 16679,
"preview": "using System;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\n\nnamespace MsgKit.Mime.Decode;\n\n/// <su"
},
{
"path": "MsgKit/Mime/Decode/SizeParser.cs",
"chars": 2635,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace MsgKit.Mime.Decode;\n\n/// <summar"
},
{
"path": "MsgKit/Mime/Decode/Utility.cs",
"chars": 2551,
"preview": "using System;\nusing System.Collections.Generic;\n\nnamespace MsgKit.Mime.Decode;\n\n/// <summary>\n/// Contains common o"
},
{
"path": "MsgKit/Mime/Header/ContentTransferEncoding.cs",
"chars": 730,
"preview": "using System;\n\nnamespace MsgKit.Mime.Header;\n\n/// <summary>\n/// <see cref=\"Enum\" /> that describes the ContentTrans"
},
{
"path": "MsgKit/Mime/Header/HeaderExtractor.cs",
"chars": 5417,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nnamespace MsgKit.Mime.Header;\n\n///"
},
{
"path": "MsgKit/Mime/Header/HeaderFieldParser.cs",
"chars": 10804,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Mail;\nusing System.Net.Mime;\nusing "
},
{
"path": "MsgKit/Mime/Header/MessageHeader.cs",
"chars": 21531,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Net.Mail;\nusing Syst"
},
{
"path": "MsgKit/Mime/Header/Received.cs",
"chars": 5469,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\nusing MsgKit.Mime.Decode;\n\nnamesp"
},
{
"path": "MsgKit/Mime/Header/RfcMailAddress.cs",
"chars": 10404,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Mail;\nusing MsgKit.Mime.Decode;\n\nna"
},
{
"path": "MsgKit/MsgKit.csproj",
"chars": 2702,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n\t<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFra"
},
{
"path": "MsgKit/MsgKit.xml",
"chars": 488020,
"preview": "<?xml version=\"1.0\"?>\n\n<doc>\n <assembly>\n <name>MsgKit</name>\n </assembly>\n <members>\n <member name=\"T:MsgKit.A"
},
{
"path": "MsgKit/NamedPropertyMapping.cs",
"chars": 2725,
"preview": "//\n// NamedPropertyMapping.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees "
},
{
"path": "MsgKit/NamedPropertyTags.cs",
"chars": 175004,
"preview": "//\n// NamedPropertyTags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van"
},
{
"path": "MsgKit/PropertyTags.cs",
"chars": 173935,
"preview": "// ReSharper disable CommentTypo\n//\n// PropertyTags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copy"
},
{
"path": "MsgKit/Receiving.cs",
"chars": 3198,
"preview": "//\n// Receiving.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde."
},
{
"path": "MsgKit/ReceivingRepresenting.cs",
"chars": 3535,
"preview": "//\n// ReceivingRepresenting.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees"
},
{
"path": "MsgKit/Recipient.cs",
"chars": 10344,
"preview": "//\n// Recipient.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde."
},
{
"path": "MsgKit/Representing.cs",
"chars": 3514,
"preview": "//\n// Represents.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde"
},
{
"path": "MsgKit/Rtf/Compressor.cs",
"chars": 9582,
"preview": "//\n// RtfCompressor.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 2013"
},
{
"path": "MsgKit/Rtf/Encapsulator.cs",
"chars": 2624,
"preview": "using System;\nusing System.Linq;\nusing System.Text;\n// ReSharper disable UnusedMember.Global\n\nnamespace MsgKit.Rtf\n{\n "
},
{
"path": "MsgKit/Sender.cs",
"chars": 5029,
"preview": "//\n// Sender.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (w"
},
{
"path": "MsgKit/Streams/AttachmentProperties.cs",
"chars": 3223,
"preview": "//\n// AttachmentProperties.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees "
},
{
"path": "MsgKit/Streams/EmbeddedMessageProperties.cs",
"chars": 6082,
"preview": "//\n// EmbeddedMessageProperties.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 "
},
{
"path": "MsgKit/Streams/EntryStream.cs",
"chars": 10705,
"preview": "//\n// Entry.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 2013-2026 Ke"
},
{
"path": "MsgKit/Streams/GuidStream.cs",
"chars": 2149,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing MsgKit.Helpers;\nusing OpenMcdf;\n\nnamespace MsgKi"
},
{
"path": "MsgKit/Streams/NamedProperties.cs",
"chars": 5502,
"preview": "//\n// NamedProperties.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 20"
},
{
"path": "MsgKit/Streams/RecipientProperties.cs",
"chars": 3025,
"preview": "//\n// RecipientProperties.cs\n//\n// Author: RecipientRowDisplayType and associated documentation files (the \"Software\"),"
},
{
"path": "MsgKit/Streams/StringStream.cs",
"chars": 4931,
"preview": "using System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing MsgKit.Helpers;\nusing OpenMcdf;\n\nnamespace "
},
{
"path": "MsgKit/Streams/TopLevelProperties.cs",
"chars": 5685,
"preview": "//\n// TopLevelProperties.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees va"
},
{
"path": "MsgKit/Structures/AddressBookEntryId.cs",
"chars": 2642,
"preview": "//\n// AddressBookEntryId.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees va"
},
{
"path": "MsgKit/Structures/CLSID.cs",
"chars": 3259,
"preview": "//\n// CSLID.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (ww"
},
{
"path": "MsgKit/Structures/NamedProperty.cs",
"chars": 2830,
"preview": "//\n// NamedProperty.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com> and Travis Semple\n//\n// Copyright (c) 2013"
},
{
"path": "MsgKit/Structures/OneOffEntryId.cs",
"chars": 8811,
"preview": "//\n// OneOffEntryId.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spe"
},
{
"path": "MsgKit/Structures/Properties.cs",
"chars": 22658,
"preview": "//\n// Properties.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde"
},
{
"path": "MsgKit/Structures/Property.cs",
"chars": 18520,
"preview": "//\n// Property.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. "
},
{
"path": "MsgKit/Structures/RecipientRow.cs",
"chars": 19460,
"preview": "//\n// RecipientRow.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Speld"
},
{
"path": "MsgKit/Structures/RecurrencePattern.cs",
"chars": 7475,
"preview": "//\n// RecurrencePattern.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van"
},
{
"path": "MsgKit/Structures/ReportTag.cs",
"chars": 9615,
"preview": "//\n// ReportTag.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde."
},
{
"path": "MsgKit/Structures/UnsendableRecipients.cs",
"chars": 5312,
"preview": "//\n// UnsendableRecipients.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees "
},
{
"path": "MsgKit/Task.cs",
"chars": 15938,
"preview": "//\n// Task.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (www"
},
{
"path": "MsgKit/ThreadIndex.cs",
"chars": 2393,
"preview": "using System;\nusing System.Linq;\n\nnamespace MsgKit;\n\n/// <summary>\n/// Identifies a particular conversation thread;"
},
{
"path": "MsgKit/TranslateTags.cs",
"chars": 81750,
"preview": "//\n// TranslateTags.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spe"
},
{
"path": "MsgKit/app.config",
"chars": 522,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<configuration>\n <runtime>\n <assemblyBinding xmlns=\"urn:schemas-microsoft-co"
},
{
"path": "MsgKit/packages.config",
"chars": 271,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<packages>\n <package id=\"BouncyCastle\" version=\"1.8.9\" targetFramework=\"net46\" "
},
{
"path": "MsgKit.sln",
"chars": 1578,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.26730.16\nMin"
},
{
"path": "MsgKit.sln.DotSettings",
"chars": 6451,
"preview": "<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namesp"
},
{
"path": "MsgKitTestTool/EmailForm.Designer.cs",
"chars": 22671,
"preview": "namespace MsgKitTestTool\n{\n partial class MainForm\n {\n /// <summary>\n /// Required designer variabl"
},
{
"path": "MsgKitTestTool/EmailForm.cs",
"chars": 13953,
"preview": "//\n// MainForm\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. (ww"
},
{
"path": "MsgKitTestTool/EmailForm.resx",
"chars": 5696,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "MsgKitTestTool/MsgKitTestTool.csproj",
"chars": 7965,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "MsgKitTestTool/Program.cs",
"chars": 1698,
"preview": "//\n// Program.cs\n//\n// Author: Kees van Spelde <sicos2002@hotmail.com>\n//\n// Copyright (c) 2013-2026 Kees van Spelde. ("
},
{
"path": "MsgKitTestTool/Properties/AssemblyInfo.cs",
"chars": 1403,
"preview": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled "
},
{
"path": "MsgKitTestTool/Properties/Resources.Designer.cs",
"chars": 2792,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "MsgKitTestTool/Properties/Resources.resx",
"chars": 5494,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "MsgKitTestTool/Properties/Settings.Designer.cs",
"chars": 5895,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "MsgKitTestTool/Properties/Settings.settings",
"chars": 1799,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\""
},
{
"path": "MsgKitTestTool/Tests.cs",
"chars": 2018,
"preview": "using System;\n\nnamespace MsgKitTestTool\n{\n public class Tests\n {\n public void CreateAppointment()\n "
},
{
"path": "MsgKitTestTool/app.config",
"chars": 3287,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<configuration>\n <configSections>\n <sectionGroup name=\"userSettings\" "
},
{
"path": "MsgKitTestTool/packages.config",
"chars": 1002,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"BouncyCastle.Cryptography\" version=\"2.6.2\" targetFrame"
},
{
"path": "README.md",
"chars": 10767,
"preview": "## What is MsgKit?\n\nMsgKit is a 100% managed C# .NET 4.6.2, .NET Standard 2.0 and .NET Standard 2.1 assembly (no PINVOKE"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the Sicos1977/MsgKit GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 135 files (1.6 MB), approximately 396.8k tokens, and a symbol index with 372 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.