.MSG File Metadata Extraction - Sender SMTP Email





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Our organization is currently in the process of extracting a processing old .MSG files that have been stored by current and possibly former employees. As part of this process we are trying to extract the Sender SMTP email address from these old emails. However since most of these were/are internal users, the msg file has the Sender Address stored as an exchange address. We have tried the following to with no luck:



**



MsgReader.Outlook.Storage.Message



**



var senderAddress = string.Empty;
using (var msg = new Storage.Message(emailFilePath))
{
senderAddress = msg.Sender.Email;
}


**



Microsoft.Office.Interop.Outlook.MailItem



**



var senderEmailAddress = this.SafeExtractEmailAddress(mail.Sender, mail.SenderEmailAddress);


private string SafeExtractEmailAddress(AddressEntry addressEntry, string currentEmail)
{
var userEmailAddress = string.Empty;

if (addressEntry != null &&
(addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeUserAddressEntry
|| addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeRemoteUserAddressEntry))
{
userEmailAddress = addressEntry.GetExchangeUser()?.PrimarySmtpAddress;
}

if (string.IsNullOrWhiteSpace(userEmailAddress))
{
var recipient = this.outlookApplication.Session.CreateRecipient(currentEmail);
var exchangeUser = recipient?.AddressEntry.GetExchangeUser();

userEmailAddress = exchangeUser?.PrimarySmtpAddress ?? currentEmail;

recipient.SafeRelease();
exchangeUser.SafeRelease();
}

return userEmailAddress.ToLowerInvariant();
}


**



Aspose.Email.Mapi.MapiMessage



**



public string ExtractSender(MapiMessage msg)
{
if (msg == null)
{
throw new ArgumentNullException(nameof(msg));
}
var senderEmailAddress = msg.SenderEmailAddress;
ExchangeService exchangeService = this.exchangeServiceFactory.BuildService();

// Create the ResolveNamesType and set the unresolved entry.

if (msg.SenderAddressType == "EX")
{
var resolutionCollection = exchangeService.ResolveName(msg.SenderEmailAddress, ResolveNameSearchLocation.ContactsThenDirectory, true);
var nameResolutions = resolutionCollection.ToList();
if (nameResolutions.Count > 0)
{
var nameResolution = nameResolutions.ElementAt(0);
senderEmailAddress = nameResolution.Mailbox.Address;
}
}

return senderEmailAddress;
}


What other options do I have to obtain this data?










share|improve this question























  • Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

    – Dmitry Streblechenko
    Nov 16 '18 at 18:57











  • This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

    – jdweng
    Nov 16 '18 at 20:50











  • @jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

    – Ivhani Maselesele
    Nov 19 '18 at 9:24


















0















Our organization is currently in the process of extracting a processing old .MSG files that have been stored by current and possibly former employees. As part of this process we are trying to extract the Sender SMTP email address from these old emails. However since most of these were/are internal users, the msg file has the Sender Address stored as an exchange address. We have tried the following to with no luck:



**



MsgReader.Outlook.Storage.Message



**



var senderAddress = string.Empty;
using (var msg = new Storage.Message(emailFilePath))
{
senderAddress = msg.Sender.Email;
}


**



Microsoft.Office.Interop.Outlook.MailItem



**



var senderEmailAddress = this.SafeExtractEmailAddress(mail.Sender, mail.SenderEmailAddress);


private string SafeExtractEmailAddress(AddressEntry addressEntry, string currentEmail)
{
var userEmailAddress = string.Empty;

if (addressEntry != null &&
(addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeUserAddressEntry
|| addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeRemoteUserAddressEntry))
{
userEmailAddress = addressEntry.GetExchangeUser()?.PrimarySmtpAddress;
}

if (string.IsNullOrWhiteSpace(userEmailAddress))
{
var recipient = this.outlookApplication.Session.CreateRecipient(currentEmail);
var exchangeUser = recipient?.AddressEntry.GetExchangeUser();

userEmailAddress = exchangeUser?.PrimarySmtpAddress ?? currentEmail;

recipient.SafeRelease();
exchangeUser.SafeRelease();
}

return userEmailAddress.ToLowerInvariant();
}


**



Aspose.Email.Mapi.MapiMessage



**



public string ExtractSender(MapiMessage msg)
{
if (msg == null)
{
throw new ArgumentNullException(nameof(msg));
}
var senderEmailAddress = msg.SenderEmailAddress;
ExchangeService exchangeService = this.exchangeServiceFactory.BuildService();

// Create the ResolveNamesType and set the unresolved entry.

if (msg.SenderAddressType == "EX")
{
var resolutionCollection = exchangeService.ResolveName(msg.SenderEmailAddress, ResolveNameSearchLocation.ContactsThenDirectory, true);
var nameResolutions = resolutionCollection.ToList();
if (nameResolutions.Count > 0)
{
var nameResolution = nameResolutions.ElementAt(0);
senderEmailAddress = nameResolution.Mailbox.Address;
}
}

return senderEmailAddress;
}


What other options do I have to obtain this data?










share|improve this question























  • Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

    – Dmitry Streblechenko
    Nov 16 '18 at 18:57











  • This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

    – jdweng
    Nov 16 '18 at 20:50











  • @jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

    – Ivhani Maselesele
    Nov 19 '18 at 9:24














0












0








0








Our organization is currently in the process of extracting a processing old .MSG files that have been stored by current and possibly former employees. As part of this process we are trying to extract the Sender SMTP email address from these old emails. However since most of these were/are internal users, the msg file has the Sender Address stored as an exchange address. We have tried the following to with no luck:



**



MsgReader.Outlook.Storage.Message



**



var senderAddress = string.Empty;
using (var msg = new Storage.Message(emailFilePath))
{
senderAddress = msg.Sender.Email;
}


**



Microsoft.Office.Interop.Outlook.MailItem



**



var senderEmailAddress = this.SafeExtractEmailAddress(mail.Sender, mail.SenderEmailAddress);


private string SafeExtractEmailAddress(AddressEntry addressEntry, string currentEmail)
{
var userEmailAddress = string.Empty;

if (addressEntry != null &&
(addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeUserAddressEntry
|| addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeRemoteUserAddressEntry))
{
userEmailAddress = addressEntry.GetExchangeUser()?.PrimarySmtpAddress;
}

if (string.IsNullOrWhiteSpace(userEmailAddress))
{
var recipient = this.outlookApplication.Session.CreateRecipient(currentEmail);
var exchangeUser = recipient?.AddressEntry.GetExchangeUser();

userEmailAddress = exchangeUser?.PrimarySmtpAddress ?? currentEmail;

recipient.SafeRelease();
exchangeUser.SafeRelease();
}

return userEmailAddress.ToLowerInvariant();
}


**



Aspose.Email.Mapi.MapiMessage



**



public string ExtractSender(MapiMessage msg)
{
if (msg == null)
{
throw new ArgumentNullException(nameof(msg));
}
var senderEmailAddress = msg.SenderEmailAddress;
ExchangeService exchangeService = this.exchangeServiceFactory.BuildService();

// Create the ResolveNamesType and set the unresolved entry.

if (msg.SenderAddressType == "EX")
{
var resolutionCollection = exchangeService.ResolveName(msg.SenderEmailAddress, ResolveNameSearchLocation.ContactsThenDirectory, true);
var nameResolutions = resolutionCollection.ToList();
if (nameResolutions.Count > 0)
{
var nameResolution = nameResolutions.ElementAt(0);
senderEmailAddress = nameResolution.Mailbox.Address;
}
}

return senderEmailAddress;
}


What other options do I have to obtain this data?










share|improve this question














Our organization is currently in the process of extracting a processing old .MSG files that have been stored by current and possibly former employees. As part of this process we are trying to extract the Sender SMTP email address from these old emails. However since most of these were/are internal users, the msg file has the Sender Address stored as an exchange address. We have tried the following to with no luck:



**



MsgReader.Outlook.Storage.Message



**



var senderAddress = string.Empty;
using (var msg = new Storage.Message(emailFilePath))
{
senderAddress = msg.Sender.Email;
}


**



Microsoft.Office.Interop.Outlook.MailItem



**



var senderEmailAddress = this.SafeExtractEmailAddress(mail.Sender, mail.SenderEmailAddress);


private string SafeExtractEmailAddress(AddressEntry addressEntry, string currentEmail)
{
var userEmailAddress = string.Empty;

if (addressEntry != null &&
(addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeUserAddressEntry
|| addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeRemoteUserAddressEntry))
{
userEmailAddress = addressEntry.GetExchangeUser()?.PrimarySmtpAddress;
}

if (string.IsNullOrWhiteSpace(userEmailAddress))
{
var recipient = this.outlookApplication.Session.CreateRecipient(currentEmail);
var exchangeUser = recipient?.AddressEntry.GetExchangeUser();

userEmailAddress = exchangeUser?.PrimarySmtpAddress ?? currentEmail;

recipient.SafeRelease();
exchangeUser.SafeRelease();
}

return userEmailAddress.ToLowerInvariant();
}


**



Aspose.Email.Mapi.MapiMessage



**



public string ExtractSender(MapiMessage msg)
{
if (msg == null)
{
throw new ArgumentNullException(nameof(msg));
}
var senderEmailAddress = msg.SenderEmailAddress;
ExchangeService exchangeService = this.exchangeServiceFactory.BuildService();

// Create the ResolveNamesType and set the unresolved entry.

if (msg.SenderAddressType == "EX")
{
var resolutionCollection = exchangeService.ResolveName(msg.SenderEmailAddress, ResolveNameSearchLocation.ContactsThenDirectory, true);
var nameResolutions = resolutionCollection.ToList();
if (nameResolutions.Count > 0)
{
var nameResolution = nameResolutions.ElementAt(0);
senderEmailAddress = nameResolution.Mailbox.Address;
}
}

return senderEmailAddress;
}


What other options do I have to obtain this data?







c# email exchangewebservices office-interop aspose






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 18:38









Ivhani MaseleseleIvhani Maselesele

212




212













  • Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

    – Dmitry Streblechenko
    Nov 16 '18 at 18:57











  • This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

    – jdweng
    Nov 16 '18 at 20:50











  • @jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

    – Ivhani Maselesele
    Nov 19 '18 at 9:24



















  • Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

    – Dmitry Streblechenko
    Nov 16 '18 at 18:57











  • This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

    – jdweng
    Nov 16 '18 at 20:50











  • @jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

    – Ivhani Maselesele
    Nov 19 '18 at 9:24

















Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

– Dmitry Streblechenko
Nov 16 '18 at 18:57





Take a look at the MSG file with OutlokSpy (click OpenIMsgOnIStg button) - chances are ptagSenderSmtpAddress property will be present.

– Dmitry Streblechenko
Nov 16 '18 at 18:57













This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

– jdweng
Nov 16 '18 at 20:50





This may be a credential issue. The email address is stored in the User Account c:Users (in XP it was Document and Settings).

– jdweng
Nov 16 '18 at 20:50













@jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

– Ivhani Maselesele
Nov 19 '18 at 9:24





@jdweng I'm not sure how that will resolve our issue of extracting smtp email addresses from historic .msg email files. Please elaborate.

– Ivhani Maselesele
Nov 19 '18 at 9:24












1 Answer
1






active

oldest

votes


















0














While using Aspose.Email.Mapi.MapiMessage, the object of this class has following properties returning Sender information:




  • msg.SenderEmailAddress

  • msg.SenderSmtpAddress


Both properties get or set the message sender's e-mail address.



You may use the following code snippet to load and read MSG information:



// Create an instance of MapiMessage from file
MapiMessage msg = MapiMessage.FromFile(dataDir + @"message.msg");

// Get subject
Console.WriteLine("Subject:" + msg.Subject);

// Get from address
Console.WriteLine("Sender:" + msg.SenderEmailAddress);
Console.WriteLine("Sender SMTP:" + msg.SenderSmtpAddress);

// Get body
Console.WriteLine("Body" + msg.Body);

// Get recipients information
Console.WriteLine("Recipient: " + msg.Recipients);

// Get attachments
foreach (MapiAttachment att in msg.Attachments)
{
Console.Write("Attachment Name: " + att.FileName);
Console.Write("Attachment Display Name: " + att.DisplayName);
}


Note: I am working as Support developer/ Evangelist at Aspose.






share|improve this answer


























  • The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

    – Ivhani Maselesele
    Nov 18 '18 at 0:28











  • In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

    – mzk
    Nov 19 '18 at 4:32













  • Folder information can only be extracted from PST.

    – mzk
    Nov 19 '18 at 4:39











  • We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

    – Ivhani Maselesele
    Nov 19 '18 at 9:22











  • You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

    – mzk
    Nov 20 '18 at 4:48












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343607%2fmsg-file-metadata-extraction-sender-smtp-email%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














While using Aspose.Email.Mapi.MapiMessage, the object of this class has following properties returning Sender information:




  • msg.SenderEmailAddress

  • msg.SenderSmtpAddress


Both properties get or set the message sender's e-mail address.



You may use the following code snippet to load and read MSG information:



// Create an instance of MapiMessage from file
MapiMessage msg = MapiMessage.FromFile(dataDir + @"message.msg");

// Get subject
Console.WriteLine("Subject:" + msg.Subject);

// Get from address
Console.WriteLine("Sender:" + msg.SenderEmailAddress);
Console.WriteLine("Sender SMTP:" + msg.SenderSmtpAddress);

// Get body
Console.WriteLine("Body" + msg.Body);

// Get recipients information
Console.WriteLine("Recipient: " + msg.Recipients);

// Get attachments
foreach (MapiAttachment att in msg.Attachments)
{
Console.Write("Attachment Name: " + att.FileName);
Console.Write("Attachment Display Name: " + att.DisplayName);
}


Note: I am working as Support developer/ Evangelist at Aspose.






share|improve this answer


























  • The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

    – Ivhani Maselesele
    Nov 18 '18 at 0:28











  • In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

    – mzk
    Nov 19 '18 at 4:32













  • Folder information can only be extracted from PST.

    – mzk
    Nov 19 '18 at 4:39











  • We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

    – Ivhani Maselesele
    Nov 19 '18 at 9:22











  • You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

    – mzk
    Nov 20 '18 at 4:48
















0














While using Aspose.Email.Mapi.MapiMessage, the object of this class has following properties returning Sender information:




  • msg.SenderEmailAddress

  • msg.SenderSmtpAddress


Both properties get or set the message sender's e-mail address.



You may use the following code snippet to load and read MSG information:



// Create an instance of MapiMessage from file
MapiMessage msg = MapiMessage.FromFile(dataDir + @"message.msg");

// Get subject
Console.WriteLine("Subject:" + msg.Subject);

// Get from address
Console.WriteLine("Sender:" + msg.SenderEmailAddress);
Console.WriteLine("Sender SMTP:" + msg.SenderSmtpAddress);

// Get body
Console.WriteLine("Body" + msg.Body);

// Get recipients information
Console.WriteLine("Recipient: " + msg.Recipients);

// Get attachments
foreach (MapiAttachment att in msg.Attachments)
{
Console.Write("Attachment Name: " + att.FileName);
Console.Write("Attachment Display Name: " + att.DisplayName);
}


Note: I am working as Support developer/ Evangelist at Aspose.






share|improve this answer


























  • The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

    – Ivhani Maselesele
    Nov 18 '18 at 0:28











  • In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

    – mzk
    Nov 19 '18 at 4:32













  • Folder information can only be extracted from PST.

    – mzk
    Nov 19 '18 at 4:39











  • We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

    – Ivhani Maselesele
    Nov 19 '18 at 9:22











  • You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

    – mzk
    Nov 20 '18 at 4:48














0












0








0







While using Aspose.Email.Mapi.MapiMessage, the object of this class has following properties returning Sender information:




  • msg.SenderEmailAddress

  • msg.SenderSmtpAddress


Both properties get or set the message sender's e-mail address.



You may use the following code snippet to load and read MSG information:



// Create an instance of MapiMessage from file
MapiMessage msg = MapiMessage.FromFile(dataDir + @"message.msg");

// Get subject
Console.WriteLine("Subject:" + msg.Subject);

// Get from address
Console.WriteLine("Sender:" + msg.SenderEmailAddress);
Console.WriteLine("Sender SMTP:" + msg.SenderSmtpAddress);

// Get body
Console.WriteLine("Body" + msg.Body);

// Get recipients information
Console.WriteLine("Recipient: " + msg.Recipients);

// Get attachments
foreach (MapiAttachment att in msg.Attachments)
{
Console.Write("Attachment Name: " + att.FileName);
Console.Write("Attachment Display Name: " + att.DisplayName);
}


Note: I am working as Support developer/ Evangelist at Aspose.






share|improve this answer















While using Aspose.Email.Mapi.MapiMessage, the object of this class has following properties returning Sender information:




  • msg.SenderEmailAddress

  • msg.SenderSmtpAddress


Both properties get or set the message sender's e-mail address.



You may use the following code snippet to load and read MSG information:



// Create an instance of MapiMessage from file
MapiMessage msg = MapiMessage.FromFile(dataDir + @"message.msg");

// Get subject
Console.WriteLine("Subject:" + msg.Subject);

// Get from address
Console.WriteLine("Sender:" + msg.SenderEmailAddress);
Console.WriteLine("Sender SMTP:" + msg.SenderSmtpAddress);

// Get body
Console.WriteLine("Body" + msg.Body);

// Get recipients information
Console.WriteLine("Recipient: " + msg.Recipients);

// Get attachments
foreach (MapiAttachment att in msg.Attachments)
{
Console.Write("Attachment Name: " + att.FileName);
Console.Write("Attachment Display Name: " + att.DisplayName);
}


Note: I am working as Support developer/ Evangelist at Aspose.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 '18 at 16:43

























answered Nov 17 '18 at 6:27









mzkmzk

21923




21923













  • The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

    – Ivhani Maselesele
    Nov 18 '18 at 0:28











  • In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

    – mzk
    Nov 19 '18 at 4:32













  • Folder information can only be extracted from PST.

    – mzk
    Nov 19 '18 at 4:39











  • We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

    – Ivhani Maselesele
    Nov 19 '18 at 9:22











  • You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

    – mzk
    Nov 20 '18 at 4:48



















  • The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

    – Ivhani Maselesele
    Nov 18 '18 at 0:28











  • In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

    – mzk
    Nov 19 '18 at 4:32













  • Folder information can only be extracted from PST.

    – mzk
    Nov 19 '18 at 4:39











  • We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

    – Ivhani Maselesele
    Nov 19 '18 at 9:22











  • You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

    – mzk
    Nov 20 '18 at 4:48

















The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

– Ivhani Maselesele
Nov 18 '18 at 0:28





The sender smtp came out null. I believe some of these messages may have been save from the user's sent mail folder. Maybe this is the reason we cannot get the sender smtp using Aspose?

– Ivhani Maselesele
Nov 18 '18 at 0:28













In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

– mzk
Nov 19 '18 at 4:32







In that case, you may get folder information as well, like as:// get the folders and messages information FolderInfo folderInfo = pst.RootFolder; FolderInfoCollection folders = folderInfo.GetSubFolders(); foreach (FolderInfo myfolderInfo in folders) { Console.WriteLine("Folder: " + folderInfo.DisplayName); }

– mzk
Nov 19 '18 at 4:32















Folder information can only be extracted from PST.

– mzk
Nov 19 '18 at 4:39





Folder information can only be extracted from PST.

– mzk
Nov 19 '18 at 4:39













We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

– Ivhani Maselesele
Nov 19 '18 at 9:22





We only have .MSG files to extract information from. These are emails that have been stored by different employees over the past couple of years.

– Ivhani Maselesele
Nov 19 '18 at 9:22













You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

– mzk
Nov 20 '18 at 4:48





You may check the type of sender address by reading "msg.SenderAddressType" which shows message sender's email address type. In case SenderAddressType is EX, the email address is not saved but you may find a long string against "msg.SenderEmailAddress".

– mzk
Nov 20 '18 at 4:48




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343607%2fmsg-file-metadata-extraction-sender-smtp-email%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma