IIS에서 asp.net 웹 사이트를 통해 Outlook에서 메일 첨부 파일을 열려고하면이 오류가 발생합니다. IIS USR 및 네트워크에 DCOMCnfg에서 Microsoft OutLook 구성 요소로의 전체 사용 권한을 할당하지만 아무런 효과가 없습니다.구성 요소에 대한 COM 클래스 팩터 리를 가져 오지 못했습니다. 접근이 금지되어있다. HRESULT : 0x80070005 E_ACCESSDENIED
CLSID가 {0006F03A-0000-0000-C000-000000000046} 인 구성 요소의 COM 클래스 팩터 리를 검색하는 데 다음 오류로 인해 실패했습니다 : 80070005 액세스가 거부되었습니다. (HRESULT 예외 : 0x80070005 (E_ACCESSDENIED)).
using System;
using Outlook = Microsoft.Office.Interop.Outlook;
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();
// Create a new mail item.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
// Set HTMLBody.
//add the body of the email
oMsg.HTMLBody = "Hello, This is test for sending pdf attachment using OutLook";
//Add an attachment.
String sDisplayName = "MyAttachment";
int iPosition = (int)oMsg.Body.Length + 1;
int iAttachType = (int)Outlook.OlAttachmentType.olByValue;
//now attached the file
Outlook.Attachment oAttach = oMsg.Attachments.Add(Server.MapPath("~/TestSendFile.pdf"), iAttachType, iPosition, sDisplayName);
//Subject line
oMsg.Subject = "Your Subject will go here.";
// Add a recipient.
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
// Change the recipient in the next line if necessary.
Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add("[email protected]");
oRecip.Resolve();
// Send.
oMsg.Display();
안녕하세요 드미트리 씨, 제발 실례 나 링크를 보여 주시겠습니까? 내 localhost 사이트에서이 시도하고 모든 가능한 오른쪽 있지만 동일한 오류가 할당됩니다. 가능하다면 매우 감사 할 것입니다. – Ammad
예를 들면? 위의 6 가지 옵션 중 어느 것입니까? –