Dinesh Haraveer
Dinesh Haraveer

Reputation: 1804

Asp.Net Application Deployed getting Operation aborted (Exception from hresult 0x80040e14 (E_ABORT))

I have an asp.net application which i'm sending a mail, with attachment of a file which is stored in the local drive.The code written to send mail by using outlook com object to sent mail.As the code works fine in the client side(No Errors works Fine) but i deployed the application into the remote server,getting an error "Operation aborted (Exception from hresult 0x80040e14 (E_ABORT))". I tried in the net,searching for solution but any one of the solution is not resolving my problem.

The Code written is

 string ticks = DateTime.Now.Ticks.ToString();

 Outlook.Application objOutlook = new Outlook.Application();
            objOutlook.ActiveExplorer();
            //application.Visible = true;

            Outlook.Application outlookApp = new Outlook.Application();

            Outlook.MailItem message = (Outlook.MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem);

            message.Subject = "Test PPT";

            message.Body = " find Test PPT attached tp this mail";

            //message.Recipients.Add("[email protected]");

            message.Body = "Please find Test PPT attached tp this mail";

            message.Attachments.Add(@"D:\TempFiles\AttachedPPT" + ticks + ".pptx", message.Body.Length + 1, Outlook.OlAttachmentType.olByValue, "MyAttachment");

            message.Display(false);

Does any one tell why i'm getting error when deployed into the remote server only.

Upvotes: 0

Views: 393

Answers (1)

Devunipalli
Devunipalli

Reputation: 50

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

For more information Link

Upvotes: 1

Related Questions