0
在我的開發機器我開發了一種工作沒有問題的方法。它是一個簡單的按鈕,當我點擊它打開一個電子郵件地址和一些內容的Outlook電子郵件但是,當我將代碼發送到生產環境...所有用戶都在頁面的page_load上設置了以下方法的錯誤。「發送電子郵件到」與Microsoft.Office.Interop.Outlook
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);
}
什麼是錯誤,我的水晶球此刻正在眨眼。 – OTTA