Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Outlook account via C#?

Need to configure email, name, mail server and other by c#. How do I do this without using Outlook Redemption?

like image 878
Doberman Avatar asked Oct 06 '22 23:10

Doberman


1 Answers

First, create a PRF file - either manually or dynamically via your .NET application.

Then, to import the account you launch Outlook with the command line option:

outlook.exe /importprf C:\SomePath\FileName.prf

This can be done within your C# code using the System.Diagnostics.Process class.

like image 188
nicholas Avatar answered Oct 13 '22 11:10

nicholas