Free Support Forum - aspose.com

Not able to convert attachment of.partial.emlx to .eml using Aspose.Email for .Net under Mac OS(High Sierra)


#1

Dear Support,

I am converting .partial.emlx to .eml using Aspose.Email for .Net under Mac OS(High Sierra). Library converting only mail’s body and its headers(Subject, To, CC, Date .etc). But it is not converting its attachment which is saved in 75590.2.emlxpart in encoded form by Apple mail.

Please find the attached sample file.

Emlx File.zip (504.9 KB)


#2

@qtsoft

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


#3

@qtsoft

It is requested to kindly share some more such partial files, preferable with 2 or more attachments or linked resources. Can you please provide to us?


#4

Sure. Please find the attached file


#5

All Mail.zip (1.0 MB)


#6

If you need more sample file please share the link to upload large data.


#7

@qtsoft

Thank you for the files. You may upload files to third party storage like GDrive or Drop box and share the link with us.


#8

@qtsoft

We have investigated this issue and found that this is not a bug of Aspose.Email. For various versions of the MAC, the paths for saving partial files, their names and formats may be different, therefore it is a very difficult task to implement the general case. However, you may use the following code to correctly convert files to EML format:

var filename = Path.Combine(TestUtil.GetTestPath("EMAILNET_39219"), "80394.partial.emlx");
var lrFilename = Path.Combine(TestUtil.GetTestPath("EMAILNET_39219"), "80394.1.2.emlxpart");
var attFilename = Path.Combine(TestUtil.GetTestPath("EMAILNET_39219"), "80394.2.emlxpart");

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

message.LinkedResources[0].ContentStream = new MemoryStream(Convert.FromBase64String(File.ReadAllText(lrFilename)));
message.Attachments[0].ContentStream = new MemoryStream(Convert.FromBase64String(File.ReadAllText(attFilename))); 

message.Save(filename + ".eml");

Moreover, please feel free to write back to us if you need additional information or you have any further queries.


#9

Dear Support,

In follow line you are passing “EMAILNET_39219”. Please tell me about this argument.

Path.Combine(TestUtil.GetTestPath(“EMAILNET_39219”), “80394.partial.emlx”);

I have to convert each file (.partial.emlx) on run time using my tool. There may be many numbers of files. I search file into directory(which can contain .emlx, .partial.emlx, .emlxpart) one by one and after getting one I convert it and repeat this again and again. So please tell me the solution for run time.

Thanks and Regards


#10

@qtsoft

Thank you for writing back to us.

The given below statement is combining the path of directory and the file whereas “EMAILNET_39219” is representing the directory that we have created locally to test this issue. You may use your custom path to specific file.

Path.Combine(TestUtil.GetTestPath(“EMAILNET_39219”), “80394.partial.emlx”);