You can't.
If this is an Outlook account that's already configured then it would have
to be the default sending account. If it's Outlook 2007 you can intercept
the item.Send event or the Application.ItemSend event and use the Accounts
collection to get the desired Account and set the item.SendUsingAccount
object property to the desired account.
With other versions of Outlook you can't do that. In no version of Outlook
can you set the password for an account as you use it.
--
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
<ProgrammingTestAccount DeleteThis @gmail.com> wrote in message
news:1185160174.048422.169320@e9g2000prf.googlegroups.com...
> I'm trying to write a program that uses Outlook to send and receive
> mails for a certain account, and I want to programly enter the
> password for the account when execute send and receive command, how
> can I do that?
>