Created app who send email in outlook 2016 but not in outlook 2013. Getting error when try to send in outlook 2013 RRS feed

  • Question

  • Hi there,

    I have an program what is sending email to clients such as invoice in PDF. I have created the program in outlook 2016, but a client of my have outlook 2013. There is an error

    Outlook error

    The code i have written:

    using Microsoft.Office.Interop.Outlook;
    using Exception = Microsoft.Office.Interop.Outlook.Exception;
    using OutlookApp = Microsoft.Office.Interop.Outlook.Application;
    OutlookApp outlookApp = new OutlookApp();
                    MailItem mailItem = outlookApp.CreateItem(OlItemType.olMailItem);
                    mailItem.Subject = subject + " " + HovenierStart.bedrijfsNaam;
                    mailItem.HTMLBody = body;
                    mailItem.To = email;
                    //Set a high priority to the message
                    mailItem.Importance = OlImportance.olImportanceHigh;

    In the init i put:

    Type officeType = Type.GetTypeFromProgID("Outlook.Application");

    Past the test but failed.

    Hoping for a solution


    Greetings from Amsterdam the Netherlands

    Tuesday, December 4, 2018 5:16 PM

All replies