in my development machine I developed a method that work without problem. Its a simple button and when I clicked it open an outlook email with a email adress and some content But when I sent the code to the production enviroment... all users are getting an error on page_load of the page where the following method are set.
protected void btnSendEmail_Click(object sender, ImageClickEventArgs e)
{
//...
Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook._MailItem oMailItem = (Microsoft.Office.Interop.Outlook._MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
string name = someDataTable.Rows[0]["NAME"].ToString();
string url = HttpContext.Current.Request.Url.AbsoluteUri;
oMailItem.To = [email protected];
oMailItem.Body = string.Format("hi {0}, \n \n [Insert the content mail here.] \n \n {1} ", name, url);
oMailItem.Subject = "Some Title";
oMailItem.Display(false);
}