I've got a file (a btmap called secretimage) that I want to attach to a mail when the user hits a button. I'ld like to use Outlook for this.
So this is what I've done:
using Outlook = Microsoft.Office.Interop.Outlook;
private void cmdSend_Click(object sender, EventArgs e)
{
Outlook.Application app = new Outlook.Application();
Outlook.MailItem mail = new Outlook.MailItem();
Outlook.Attachment attach = mail.Attachments.Add(secretImage, Outlook.OlAttachmentType.olByValue, 0, "Secret message");
}
Though this gives me the following error:
Retrieving the COM class factory for component with CLSID {00061033-0000-0000-C000-000000000046} failed due to the following error: 80040154 Klasse nicht registriert (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
The last part is German, I don't know why, actually I've set the language to English. "Klasse nicht registriert" translates "Class not registered".
I tried to do what is recommended here: Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154 Though that didn't work.
Can anyone help me here? I'm really stuck.