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

Programmatically changing the message's sender field in MAPI.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 7th 07, 04:01 AM posted to microsoft.public.outlook.program_addins
JahMic
external usenet poster
 
Posts: 35
Default Programmatically changing the message's sender field in MAPI.

Using outlook as a user, there are 2 ways to change the 'from' field,
one is actually choosing or typing in address in the 'from' line, but
that outputs a 'sent on behalf of' type of message. Using the
Accounts drop-down changes the low-level fields. The latter is
functionality I want.

Is it actually as easy as changing the PR_SENDER properties? Or do I
have to actually login into that account and send it from there? If
so, how can I take all my existing properties with me?

Of course, if there is a simpler way of doing this using OOM (without
security warnings), I would like to know about that too.

Thanks in advance,

J

Ads
  #2  
Old August 8th 07, 07:37 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Programmatically changing the message's sender field in MAPI.

Outlook 2007 - MailItem.SendUsingAccount property
MAPI - two named properties
(http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8580001E
and
http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8581001E)
that contain the id and name of the account.
plugRedemption - RDOMail.Account property (see
http://www.dimastr.com/redemption/rdo/RDOMail.htm) /plug

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"JahMic" wrote in message
ups.com...
Using outlook as a user, there are 2 ways to change the 'from' field,
one is actually choosing or typing in address in the 'from' line, but
that outputs a 'sent on behalf of' type of message. Using the
Accounts drop-down changes the low-level fields. The latter is
functionality I want.

Is it actually as easy as changing the PR_SENDER properties? Or do I
have to actually login into that account and send it from there? If
so, how can I take all my existing properties with me?

Of course, if there is a simpler way of doing this using OOM (without
security warnings), I would like to know about that too.

Thanks in advance,

J



  #3  
Old August 15th 07, 01:15 PM posted to microsoft.public.outlook.program_addins
JahMic
external usenet poster
 
Posts: 35
Default Programmatically changing the message's sender field in MAPI.

Well, it would have been easier if I just had to support o2007 or
could use redemption.

Insteadt, I had to do the following:

To check the sender:

OnSend,

check the to see if the named property 0x8581 (same as below) is set,
if so, parse that a bit to get the email account.
if not present, just the default sender via session QueryIdentity.

To change the sender,

Enumerate and find the indended account, via the IOlkAccountManager
api.
and set the PR_PRIMARY_SEND_ACCT & PR_NEXT_SEND_ACCT accordingly.

Too much work..

J

On Aug 9, 3:37 am, "Dmitry Streblechenko" wrote:
Outlook 2007 - MailItem.SendUsingAccount property
MAPI - two named properties
(http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8580001E
andhttp://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8581001E)
that contain the id and name of the account.
plugRedemption - RDOMail.Account property (seehttp://www.dimastr.com/redemption/rdo/RDOMail.htm) /plug

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"JahMic" wrote in message

ups.com...



Using outlook as a user, there are 2 ways to change the 'from' field,
one is actually choosing or typing in address in the 'from' line, but
that outputs a 'sent on behalf of' type of message. Using the
Accounts drop-down changes the low-level fields. The latter is
functionality I want.


Is it actually as easy as changing the PR_SENDER properties? Or do I
have to actually login into that account and send it from there? If
so, how can I take all my existing properties with me?


Of course, if there is a simpler way of doing this using OOM (without
security warnings), I would like to know about that too.


Thanks in advance,


J- Hide quoted text -


- Show quoted text -



 




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
Programmatically update Free/Busy Information via CDO or MAPI? Scott Townsend Outlook - Calandaring 3 January 3rd 07 02:05 PM
How can I delete MAPI/Outlook profiles Programmatically. news.microsoft.com Outlook - General Queries 3 November 14th 06 05:52 PM
how to point MAPI at express, how to get sender email ? Tony Epton Outlook and VBA 1 April 16th 06 11:07 PM
how to point MAPI interface at Express, how to get email of sender Tony Epton Outlook - General Queries 0 April 15th 06 03:39 PM
Programmatically changing settings in Outlook 2003 Jonathan Add-ins for Outlook 1 April 7th 06 07:49 PM


All times are GMT +1. The time now is 09:32 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.