Hi,
I want to convert EML file to MSG file. I tried to use examples from this. Code looks like this:
public static void ConvertToMsg(string fileName)
{
var message = Aspose.Email.Mail.MailMessage.Load(fileName);
message.Save(@“E:\TempUploadFolder\TestMsg.msg”,MailMessageSaveType.OutlookMessageFormatUnicode);
message.Dispose();
}
I was able to convert the email file but images inside body (embedded images) were replaced with unknown link.
I have attached both EML and MSG files.
Hi Jason,
I have initialized license (I no longer get “This is evaluation copy” message in header) using embedded resource method and following code:
private void InitializeAsposeLicense()
{
using (Trace.Main.scope())
{
try
{
var license = new License();
license.SetLicense(
@“Aspose.Email.lic”);
}
catch (Exception ex)
{
Trace.Main.exception(ex);
}
}
}
Aspose.Email version info:
I am using .net 4.0 version.
Did you use the same code I pasted above?
I tried with very simple code without success:
namespace Aspose.Mail.EmbeddedImages
{
internal class Program
{
private static void Main(string[] args)
{
const string dataDir =
@“C:\Users\user\Desktop\ConvertToMsg”;
#region Converting EML to MSG keeping MSG intact
var message = MailMessage.Load(dataDir + @“test.eml”);
message.Save(dataDir + @“test.msg”, MailMessageSaveType.OutlookMessageFormatUnicode);
message.Dispose();
#endregion
}
}
}
Just updated Aspose.Email to 4.0 version and EML to MSG conversion start working properly.
Very important upgrade, I will say.
Hi Jason,