Launch Outlook from c# Winforms

John Noble 1 Reputation point
2026-08-10T20:48:41.9333333+00:00

Hi there,

I am trying to launch Outlook with the subject and body already completed. It works fine on my own PC but when I try it on the customers PC, it tries to start Outlook 2016 and create a new account.

 var app = new Outlook.Application();
 Outlook.MailItem mail = (Outlook.MailItem)app.CreateItem(Outlook.OlItemType.olMailItem);
 mail.Subject = "Course Enquiry";
 StringBuilder htmlContent = new StringBuilder();
 htmlContent.AppendLine("<html>");
 htmlContent.AppendLine("<body>");
 htmlContent.AppendLine("Hello " + EntFirstName.Text + ", ");
 htmlContent.AppendLine("</body>");
 mail.HTMLBody = htmlContent.ToString();
 mail.Display(true);   // Opens Outlook compose window

Outlook 2016

How can I force it use the version of Outlook that the client is actually using ?

Thanks,

J

Microsoft 365 and Office | Development | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,946 Reputation points
    2026-08-10T22:32:11.14+00:00

    The lastest version of outlook no longer supports com automation, so an older version needs to be installed.

    The approach I use is to use graph API to create a draft message, then open the draft in the browser version of outlook via the url supplied by graph API. Note, this only works with Microsoft email servers.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.