Long Subjects Lose Spaces

With Aspose.Email, we noticed the MailMessage.Subject property loses spaces for messages with long subjects. This happens with line-breaking in the underlying file (the EML source), which clients should handle transparently to the end user.

If we re-save the file in the EML format, it preserves the original subject, but if we save it in the MSG format, it corrupts the Subject by dropping the space(s).

I’ve attached a EML source file which will reproduce this behavior.

static void TestMessageLoadSave(string path)
{
using (var msg = MailMessage.Load(path, MessageFormat.Eml))
{
var pathNew = Path.GetDirectoryName(path) + Path.DirectorySeparatorChar + MakeValidFileName(msg.Subject + “.msg”);
msg.Save(pathNew, MessageFormat.Msg);
}
}
static string MakeValidFileName(string name)
{
string invalidChars = System.Text.RegularExpressions.Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars()));
string invalidReStr = string.Format(@"([{0}]*.+$)|([{0}]+)", invalidChars);
return System.Text.RegularExpressions.Regex.Replace(name, invalidReStr, “_”);
}

Hi Jay,


Thanks for writing to Aspose.Email support team.

I have analyzed the information and have re-produced the issue here successfully. I have logged this bug in our issue tracking system as NETWORKNET-33629. I will write back here as soon as some feedback is received from the developers.

The issues you have found earlier (filed as NETWORKNET-33629) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.