Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

0

Code snippet :

  public static void SendEmail(string _ToEmail, string _Subject, string _EmailBody)
{
    oApp = new Microsoft.Office.Interop.Outlook.Application();
    Microsoft.Office.Interop.Outlook.MailItem email = (Microsoft.Office.Interop.Outlook.MailItem)(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem));
    email.Recipients.Add(_ToEmail);
    email.Subject = _Subject;
    email.Body = _EmailBody;
    ((Microsoft.Office.Interop.Outlook.MailItem)email).Send();
}

this method works well when i tested it in another project(located in file system) but when tried to test it from IIS (virtual site);It throw this exception in line : email.Recipients.Add(_ToEmail);

any help will be appreciated

P.S. the ASPNET account has the administrator permission

thanks in advance.

asp.net

1 Answer

0

Make sure that the reference is set in your web.config

answered on Stack Overflow Jul 5, 2011 by SMK

User contributions licensed under CC BY-SA 3.0