Is ItemSend really too late to set SentOnBehalfOfName ?

O

Oliver Giesen

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
 
D

Dmitry Streblechenko

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
 
O

Oliver Giesen

Dmitry said:
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: (e-mail address removed)
Y!: ogiesen
 
D

Dmitry Streblechenko

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
 
O

Oliver Giesen

Dmitry said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top