Signature Cannot Be Inserted into Exported MSG Files

Hi,

we save a docx-file to a msg-file in our server-side-code. The clients can download this msg-files in our web application.
But if the message-file opens in MS Outlook, they can´t insert the MS Outlook-Standard-Signature.
How can I save the message-file for inserting the signature?

We use Aspose.Email for .NET 4.0 Version 2.7.0.0.

Hi Marc,


Thanks for writing to Aspose.Email support team.

A sample web application is created with a button on it. A sample message is created with a doc file as attachment. This application is executed and this button is pressed which causes the message to download to the client browser. This downloaded message is clicked and it opens in Outlook. Here user can add signature from the Outlook successfully.

Please give a try to the following sample code and let us know your feedback. If it does not fulfill your requirement, please send a sample application which can be used here to re-produce the issue. It will help us to assist you as soon as possible.

var mailMessage = Aspose.Email.Mail.MailMessage.Load(@“D:\TestSubject.msg”, Aspose.Email.Mail.MessageFormat.Msg);
var mailStream = new MemoryStream();
var mailOutlookMapiMessage = MapiMessage.FromMailMessage(mailMessage);
mailOutlookMapiMessage.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT);
mailOutlookMapiMessage.Save(mailStream);
mailStream.Position = 0;
byte[] buffer;
buffer = mailStream.ToArray();
Response.Clear();
Response.Buffer = true;
Response.ContentType = “application/vnd.ms-outlook”;
Response.AddHeader(“content-disposition”, “attachment;filename=” + “Sample.msg”);
Response.BinaryWrite(buffer);
Response.End();

Hi,

thank you for your help.

As attachment I send you a sample web project using your example on button1 and our example on button2 (creation of msg-file) and button3 (download msg-file).
I’m sorry but your example don’t show the “add signature”-button in my MS Outlook 2010 (look screenshot).
If I open the original-msg-file in MS Outlook 2010 without streaming it looks like it should. Only when I open the same msg-file using a response stream the signature isn’t selectable.

What do I wrong?

Hi,

i have tested the download of msg-file in different browsers. Using Internet Explorer and Chrome for downloading the msg-files works correct. The signature is selectable. Using Firefox it doesn´t work.

Hi Marc,


Thanks for writing to Aspose.Email again.

I have tried to re-produce the scenario and could observe it using Firefox. When a message is saved on disc and then opened, the signature option is available however if message is directly opened, the signature option vanishes.

I also tried same behavior using Google Chrome browser where this setting can be configured by following link: Automatically open certain types of files. Using this configuration both the actions are performed and it is observed that signature option is present there in Outlook.

I would like to share that it does not seem to be an issue with the Aspose.Email library as same stream is downloaded to the browser. Its specific behavior of Firefox which is causing this issue where as same stream is handled properly in Google Chrome browser. I would suggest that you may report this problem to some forum working on Firefox issues.

Attached is the snapshot of message properties which are stripped down by Firefox while opening message directly in Outlook. This information may help you to report this issue to the relevant Firefox forum.

Please feel free to write us back if you have any other query related to Aspose.Email, as we will be more than happy to assist you.