From email address is missing after converting .msg to .eml

Hi team,

We are using the latest Aspose.Email for .NET to convert .msg emails to .eml using the default settings:

     Aspose.Email.MailMessage msg = Aspose.Email.MailMessage.Load(msgFilePath);
      msg.Save(emlFilePath, Aspose.Email.SaveOptions.DefaultEml);

Opening the converted .eml in Outlook and then hitting reply leads to the To email address not being resolved (due to the missing From) but this resolves correctly in the original .msg email.

image.png (25.1 KB)
emails.7z (45.1 KB)

The issue can also be easily reproduced with the Online Aspose Email Converter(Email File Formats Converter | Convert Files Online):

  1. Upload an .msg file
  2. Convert to .eml
  3. Download and open in Outlook
  4. Hit ‘reply’ on the opened email and note that the email address in the To field is invalid and cannot be resolved

Note: this is potentially related to issue: From email address is empty when converting from eml to mht

Hello @mvDev,

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILNET-41281

You can obtain Paid Support Services if you need support on a priority basis, along with direct access to our Paid Support management team.

Hi @mvDev
This is not an Aspose.Email bug. The source file stores the sender’s email address in Exchange format. This format does not make sense for the EML format. Outlook gets the correct SMTP address from the TRANSPORT_MESSAGE_HEADERS property. To replicate this behavior using Aspose.Email you can use the code below:

            MapiMessage mapi = MapiMessage.Load(fileName);
            MailConversionOptions opt = new MailConversionOptions();
            if(mapi.SenderAddressType == "EX")
            {
                opt.KeepOriginalEmailAddresses = true;
            }
            MailMessage msg = mapi.ToMailMessage(opt);
            msg.Save(fileName + ".eml");
1 Like