A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to choose acount in Outlook 2007 in c#



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 28th 08, 02:43 PM posted to microsoft.public.outlook.program_addins
Vlasta
external usenet poster
 
Posts: 2
Default How to choose acount in Outlook 2007 in c#

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

  #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


  #3  
Old March 28th 08, 05:38 PM posted to microsoft.public.outlook.program_addins
Vlasta
external usenet poster
 
Posts: 2
Default How to choose acount in Outlook 2007 in c#

I tried to find somethink, but unfortunately I wasn't succsessful. Can you
give me some link with code sample? Please.
Thanks Vlasta

"Ken Slovak - [MVP - Outlook]" wrote:

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



  #4  
Old March 28th 08, 06:36 PM posted to microsoft.public.outlook.program_addins
SvenC[_2_]
external usenet poster
 
Posts: 40
Default How to choose acount in Outlook 2007 in c#

Hi Vlasta,

I tried to find somethink, but unfortunately I wasn't succsessful.
Can you give me some link with code sample? Please.
Thanks Vlasta


How did you search?
Try this:

http://www.google.com/search?q=sendUsingAccount
or
http://search.live.com/results.aspx?q=sendUsingAccount

Both show a sample on the first search result.

--
SvenC
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
remonving pop acount from Outlook 2003 laurent[_2_] Outlook - Installation 0 March 17th 08 03:56 PM
how can i set my yahoo acount on outlook? deepak nayak Outlook - General Queries 1 March 14th 08 04:02 PM
how to setup an acount in microsoft outlook Ramon Gomez Outlook - Installation 1 September 1st 07 09:53 PM
new hotmail acount configuration for http acounts on outlook 2003 New_hotmail_user_on_outlook_2003 Outlook - Installation 2 September 21st 06 12:34 AM
How do I set up a main and one sub acount in outlook 2003 Calligraphy_CAT Outlook - Installation 1 August 27th 06 07:43 AM


All times are GMT +1. The time now is 09:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.