Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Is ItemSend really too late to set SentOnBehalfOfName ?

Geek News

Is ItemSend really too late to set SentOnBehalfOfName ?
"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> 8/7/2006 1:02:22 PM
Hi!

I'm trying to set the sender address of an outgoing message from within
a COM addin (written in Delphi 7). I tried doing this from the item's
Send event handler but it seems that is already too late for this
particular property... The strange thing is that I can modify other
properties like the Subject and Body without problems. I can even see
that the new sender address is being entered correctly into the
inspector's From field if I place Message Boxes in my code to pause the
execution but nevertheless, when the message arrives at the recipient
it does not use the intended sender address. Is there anything else
that needs to be done in order to ultimately apply the sender address
(I already tried re-resolving the recipients and saving the item but
without success) or is the Item Send event really too late for this
kind of modification? If so, when would be a better point in time? BTW:
hooking the Click event on the Send button is no solution for me either
as I want my addin to kick in also when a message is being sent by
pressing Ctrl+Enter .
Current testing environment is Outlook 2003.

Any ideas?

Cheers,

Oliver
Re: Is ItemSend really too late to set SentOnBehalfOfName ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 8/7/2006 9:01:10 PM
SentOnBehalfOfName property is only applicable if you are using an Exchange
server. Is this the case?

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

"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> wrote in message
news:xn0epoz08cufxy001[ at ]news.microsoft.com...
[Quoted Text]
> Hi!
>
> I'm trying to set the sender address of an outgoing message from within
> a COM addin (written in Delphi 7). I tried doing this from the item's
> Send event handler but it seems that is already too late for this
> particular property... The strange thing is that I can modify other
> properties like the Subject and Body without problems. I can even see
> that the new sender address is being entered correctly into the
> inspector's From field if I place Message Boxes in my code to pause the
> execution but nevertheless, when the message arrives at the recipient
> it does not use the intended sender address. Is there anything else
> that needs to be done in order to ultimately apply the sender address
> (I already tried re-resolving the recipients and saving the item but
> without success) or is the Item Send event really too late for this
> kind of modification? If so, when would be a better point in time? BTW:
> hooking the Click event on the Send button is no solution for me either
> as I want my addin to kick in also when a message is being sent by
> pressing Ctrl+Enter .
> Current testing environment is Outlook 2003.
>
> Any ideas?
>
> Cheers,
>
> Oliver


Re: Is ItemSend really too late to set SentOnBehalfOfName ?
"Oliver Giesen" <ogware[ at ]gmx.net> 8/7/2006 9:15:36 PM
Dmitry Streblechenko wrote:

[Quoted Text]
> SentOnBehalfOfName property is only applicable if you are using an
> Exchange server. Is this the case?

Yes, it is. Setting SentOnBehalfOfName at an earlier stage, e.g.
Inspector.Activate works fine but is not what I want in this particular
case.

Cheers,

--
Oliver
----- ------------------
ICQ: 18777742 (http://wwp.icq.com/18777742)
MSN: ogiesen[ at ]hotmail.com
Y!: ogiesen
Re: Is ItemSend really too late to set SentOnBehalfOfName ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 8/8/2006 4:37:45 AM
It could be that Outlook resolves the SentOnBehalfOfName property to the
relevant PR_SENT_REPRESENTING_xxx properties before ItemSend is called.
Did you try to set PR_SENT_REPRESENTING_xxx properties explicitly using
MAPI?

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

"Oliver Giesen" <ogware[ at ]gmx.net> wrote in message
news:xn0eppbzlxp72p000[ at ]news.microsoft.com...
[Quoted Text]
> Dmitry Streblechenko wrote:
>
>> SentOnBehalfOfName property is only applicable if you are using an
>> Exchange server. Is this the case?
>
> Yes, it is. Setting SentOnBehalfOfName at an earlier stage, e.g.
> Inspector.Activate works fine but is not what I want in this particular
> case.
>
> Cheers,
>
> --
> Oliver
> ----- ------------------
> ICQ: 18777742 (http://wwp.icq.com/18777742)
> MSN: ogiesen[ at ]hotmail.com
> Y!: ogiesen


Re: Is ItemSend really too late to set SentOnBehalfOfName ?
"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> 8/8/2006 11:57:19 AM
Dmitry Streblechenko wrote:

[Quoted Text]
> It could be that Outlook resolves the SentOnBehalfOfName property to
> the relevant PR_SENT_REPRESENTING_xxx properties before ItemSend is
> called. Did you try to set PR_SENT_REPRESENTING_xxx properties
> explicitly using MAPI?

I didn't so far but tried just now and it works great. I used
Redemption's ISafeMailItem's Fields collection to set
PR_SENT_REPRESENTING_ENTRYID and it works like a charm... :)

Thanks a bunch once more!


BTW: the same phenomenon appears when using the BeforeCheckNames
event... strange indeed. I mean, what's the point of the event when I
cannot adjust the recipients?

Cheers,

Oliver
Re: Is ItemSend really too late to set SentOnBehalfOfName ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 8/8/2006 5:19:14 PM
I don't think that was done on purpose, just a plain bug IMHO.

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

"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> wrote in message
news:xn0epqadk8m5bo000[ at ]news.microsoft.com...
[Quoted Text]
> Dmitry Streblechenko wrote:
>
>> It could be that Outlook resolves the SentOnBehalfOfName property to
>> the relevant PR_SENT_REPRESENTING_xxx properties before ItemSend is
>> called. Did you try to set PR_SENT_REPRESENTING_xxx properties
>> explicitly using MAPI?
>
> I didn't so far but tried just now and it works great. I used
> Redemption's ISafeMailItem's Fields collection to set
> PR_SENT_REPRESENTING_ENTRYID and it works like a charm... :)
>
> Thanks a bunch once more!
>
>
> BTW: the same phenomenon appears when using the BeforeCheckNames
> event... strange indeed. I mean, what's the point of the event when I
> cannot adjust the recipients?
>
> Cheers,
>
> Oliver


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net