Facing problem to convert .emlx file to eml


#1

Hi,
Dear Support,

I am converting .emlx file(Apple Mail) into .eml file under Mac OS X(10.13.6). For this I am using following code

                        string emlxPath = "/Users/sarvesh/Desktop/zzz/Mail/V5/4E9DE40D-FB4C-41A1-A138-E76445534A65/[Gmail].mbox/All Mail.mbox/046652BA-E408-439B-BB19-9313AB566960/Data/Messages/722.emlx"
                        
                        string SaveLocation = "/Users/sarvesh/Desktop/zzz/";
                        MailMessage message = MailMessage.Load(emlxPath);
                        string str = icount + ".eml";
                        message.Save(SaveLocation + "" + str, SaveOptions.DefaultEml);
                        icount++;
                        message.Dispose();

But when ever following line

MailMessage message = MailMessage.Load(strList.ElementAt(icount)); is being execute,

its throwing exception i.e. Aspose.Email.AsposeInvalidDataException has been thrown. Where I am going wrong.

Thanks and Regards


#2

@qtsoft

It is requested to kindly share sample .EMLX file so that we could investigate in detail.


#3

I am using valid license for conversion. Please find the attached .emlx file722.emlx.zip (1.3 KB)


#4

@qtsoft

Thank you for your feedback.
We have logged this issue with ID “EMAILNET-39212” for further investigation. You will automatically be informed here once we have more information to share.


#5

Same problem facing in conversion of .partial.emlx to .eml .


#6

@qtsoft

We are working on this issue and you will be updated here as soon as we have more information to share. Meanwhile, please share .partial.emlx with us.


#7

Please find attached .partial.emlx to check exception.

711.partial.emlx.zip (2.7 KB)


#8

@qtsoft

Thank you for your feedback.

We have recorded the details and will consider it during the issue resolution.


#9

@qtsoft

To correctly loading EMLX file into MailMessage, you need to use EmlxLoadOptions like as follows:

MailMessage message = MailMessage.Load(msgPath, new EmlxLoadOptions());

If format of the file or stream is unknown, FileFormatUtil can be used like this:

FileFormatInfo fileInfo = FileFormatUtil.DetectFileFormat(msgPath);

LoadOptions opt = new EmlLoadOptions();
switch (fileInfo.FileFormatType)
{
    case FileFormatType.Msg:
        opt = new MsgLoadOptions();
        break;
    case FileFormatType.Emlx:
        opt = new EmlxLoadOptions();
        break;
}

MailMessage message1 = MailMessage.Load(msgPath, opt);

message1.Save(@"D:\Aspose\187703\" + "message1_out.eml", SaveOptions.DefaultEml);

Moreover, please feel free to write back to us if you need additional information in this regard.


#10

If I am using following as suggested by you. But it is more disastrous.

FileFormatInfo fileInfo = FileFormatUtil.DetectFileFormat(msgPath);

Even I know exact file format which is .emlx. But I also tried another following code suggested by you. But I am getting an error FileFormatUtil does not exist. Which name space need to include to access FileFormatUtil . Hopefully You will resolve my ticket with high priority.

FileFormatInfo fileInfo = FileFormatUtil.DetectFileFormat(msgPath);

LoadOptions opt = new EmlLoadOptions();
switch (fileInfo.FileFormatType)
{
case FileFormatType.Msg:
opt = new MsgLoadOptions();
break;
case FileFormatType.Emlx:
opt = new EmlxLoadOptions();
break;
}

MailMessage message1 = MailMessage.Load(msgPath, opt);

message1.Save(@“D:\Aspose\187703” + “message1_out.eml”, SaveOptions.DefaultEml);


#11

@qtsoft

You need to add the following name space for FileFormatUtil:

using Aspose.Email.Tools;

Moreover, you may use the following code sample as well:

MailMessage message = MailMessage.Load(msgPath, new EmlxLoadOptions());
message.Save(@"D:\Aspose\UserData\187703\" + "message_out.eml", SaveOptions.DefaultEml);

#12

I have tried both option given by you but both are throwing exception. Kindly see the issue.


#13

@qtsoft

The provided code sample is working with “722.emlx” file. However, it is throwing exception while loading “711.partial.emlx”. So we have logged this issue with ID “EMAILNET-39216” for further investigation and we will update you as soon as we have any information to share.


#14

So I need to download the latest version of Aspose.Email for .Net library to check both issue.


#15

@qtsoft

Yes. Both of the issue are resolved in Aspose.Email for .NET 18.12.
Please feel free to write back to us if you have any further queries or if any additional information required.


#16

Dear Support,

I was adding Aspose.Email Nuget package for .Net under Mac OS(High Sierra) But there is not available Aspose.Email for .NET 18.12. Here latest updated version is 18.11. Please find the attached image to see nuget package version.

Version.png (160.7 KB)


#17

@qtsoft

We are sorry for inconvenience, Aspose.Email for .NET 18.12 shall probably be available at the end of this month.