View Single Post
  #2  
Old March 28th 08, 03:38 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to choose acount in Outlook 2007 in c#

SendUsingAccount is exactly what you want to use. Have you looked at the
code sample for using it in the Object Browser Help for SendUsingAccount? It
does work.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Vlasta" wrote in message
...
Can anybody help me how to choose acount in Outlook 2007 in c#? I have C#
application and I need to send from that application email, but not with
current acount, but with acount I choose. I try it with
mailItem.sendUsingAcount , but with no result.
My code looks like this:

Outlook.Application outlook = new Outlook.Application();
Outlook.MailItem mailItem =
(Outlook.MailItem)outlook.CreateItem(Outlook.OlIte mType.olMailItem);
mailItem.Subject = "somethink";
mailItem.To = "email adres";
mailItem.Body = "Text in body";
mailItem.Importance = Outlook.OlImportance.olImportanceLow;
mailItem.Display(false);
mailItem.Send();

Thanks for answer Vlasta


Ads