Answer the question
In order to leave comments, you need to log in
How to check if a mail account exists?
Greetings!
Please tell me how to check if a configured mail account exists on a windows system before starting Outlook using C#. Those. if mail is configured, we start Outlook, if not, we don't start it.
Thank you!
Answer the question
In order to leave comments, you need to log in
try to log in ...
it worked - we start it, it didn't work - it's not configured correctly
1) We check the presence of configured mail accounts in Outlook
2) It would be nice to check not only their presence, but also their performance (log in), as Dmitry wrote above.
Example (getting information about mail accounts):
https://msdn.microsoft.com/EN-US/library/office/ff...
Stupid somewhere, help again plz:
try
{
Outlook.Application oAccounts = new Outlook.Application();
Outlook.Accounts oCheckAcc = oAccounts.Session.Accounts;
foreach (Outlook.Account account in oCheckAcc)
{
if (account.DisplayName.ToString().Contains("@"))
{
// blablabla
}
break;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question