I have a web application with some functionality to allow a user to send an email using Microsoft.Office.Interop.Outlook.Application. I want to display the email to allow the user to add any text they may want before sending. It works as expected in localhost however in production it fails to display the email. My code is as follows:
OutlookApp outlookApp = new OutlookApp();
MailItem mailItem = outlookApp.CreateItem(OlItemType.olMailItem);
mailItem.To = address;
mailItem.Subject = subject;
mailItem.HTMLBody = body;
mailItem.Importance = OlImportance.olImportanceNormal;
mailItem.Display(false);
Outlook opens just fine when I use a Response.Redirect instead of the above.
Response.Redirect("mailto:" + email + "?subject=" + subject + "&body=" + body);
Any ideas/suggestions?