Hi I have a few sample ics files and none of them open. I am trying to convert them to msg files as per your documentation here: Convert ICS to MSG via C# | products.aspose.com
I keep getting an error “The MailMessage is corrupted” on all three examples, but I can open all of them up in Outlook. Am I missing something?
IcsLoadFailure.zip (120.2 KB)
Thanks,
Charles
@ccuster68
We have logged this problem in our issue tracking system as EMAILNET-40643. You will be notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
@ccuster68
The MailMessage class is not designed to work with the ICS format, the LOAD method accepts messages in the EML and MSG formats. Instead, to convert ICS to MSG, please use the Appointment class as shown below.
Aspose.Email.Calendar.Appointment app = Aspose.Email.Calendar.Appointment.Load(fileName);
app.Save(fileName + ".msg", Aspose.Email.Calendar.AppointmentSaveFormat.Msg);
Hi Tahir, thank you for the info, that worked. I would remove or update the link I gave in the original post, because that is no longer valid.
@ccuster68
It is nice to hear from you that your problem has been solved. Yes, you can remove the link from your post.
my .eml file has an attachment which is another email (mail within a mail), and that attached email has an ICS file as an attachment i am getting error
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter ‘length’)
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
at mm.c(String d)
at Aspose.Email.Calendar.Recurrences.CalendarRecurrence.d(String d)
at Aspose.Email.Calendar.Recurrences.CalendarRecurrence…ctor(String pattern)
at Aspose.Email.Mapi.MapiCalendarRecurrencePatternFactory.d(jK d, List`1 v, MapiCalendarTimeZone c, MapiMessageItemBase t)
at Aspose.Email.Mapi.MapiMessage.d(LK d, OutlookMessageFormat v, String c, Int32 t)
at Aspose.Email.Mapi.MapiMessage.n(MailMessage d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.m(MailMessage d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.d(Attachment d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.v(Attachment d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.d(MailMessage d, MapiMessage v, MapiConversionOptions c)
at Aspose.Email.Mapi.MapiMessage.v(MailMessage d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.FromMailMessage(MailMessage message, MapiConversionOptions options)
at Aspose.Email.Mapi.MapiMessage.FromMailMessage(MailMessage message)
also got this error in another .eml file. This file also has one .ics file and 2 .html file
System.FormatException: The specified string is not in the form required for an e-mail address.
at Aspose.Email.MailAddress.d(String d, Boolean v)
at Aspose.Email.MailAddress…ctor(String address, String displayName, Encoding displayNameEncoding, Boolean ignoreSmtpCheck)
at jr…ctor(String d)
at Lr.V.driFd(String d, String v)
at rr.d(String[] d)
at HK.d(List`1 d)
at LK.d(Stream d, Boolean v)
at Aspose.Email.Mapi.MapiMessage.n(MailMessage d, MapiConversionOptions v)
at Aspose.Email.Mapi.MapiMessage.FromMailMessage(MailMessage message, MapiConversionOptions options)
at Aspose.Email.Mapi.MapiMessage.FromMailMessage(MailMessage message)
Hello @ashish007,
Thank you for reporting the issue.
Could you please provide the sample .eml files that reproduces the error?
Having a sample will allow us to reproduce the issue and provide a more accurate solution or a possible fix.
You can remove any sensitive content before sharing if needed.