How to send using a specific account?

Add-in Express™ Support Service
That's what is more important than anything else

How to send using a specific account?
 
Marc Fisher




Posts: 11
Joined: 2005-05-21
Hi

I can sucessfully trap a sendmail event but how do I send using a specific account?

For example, based on the content in the mail, I want force Outlook to send using one of the user account profiles set up. (Like clicking on the accounts button in a new message window)

I figured it would be a function of the 'MailItem' interface, but I just can't seem to find it. :)

Thanks in advance

Marc

(Delphi6 plus registered Adx VCL lib, OL2000 model)
Posted 22 May, 2005 16:21:10 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Marc,

Unfortunately the Outlook Object Model doesn't contain any properties/methods to access e-mail accounts. But:
- you can find an account list in the windows registry
- a specific account can be set only via Extended MAPI or probably CDO

Posted 23 May, 2005 06:47:55 Top
Marc Fisher




Posts: 11
Joined: 2005-05-21
Mmm. Thats a real show-stopper for my app! :)

"- a specific account can be set only via Extended MAPI"

I know it is not strictly an Add-In-Express issue but can you guide me in the right direction as to how I might do this from the 'onsend' event.

If I can achieve this, my only hurdle would only be to put something in in the users outbox to indicate a send had been made.

You help appreciated

Marc

Posted 23 May, 2005 08:20:27 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Marc,

I know it is not strictly an Add-In-Express issue but can you guide me in the right direction as to how I might do this from the 'onsend' event.


Ok, let's try. The Outlook's _MailItem interface has the MAPIObject property (IDispatch). This is the Extended MAPI http://msdn.microsoft.com/library/en-us/mapi/html/27bd33e1-eabb-47a5-8ae3-bdb0ee01683b.asp interface. Then you will need such methods as GetProps, SetProps, SaveChanges, etc.

Posted 23 May, 2005 09:28:17 Top