Change Sender from Com Addin

R

rschisler

I have written a COM Addin for Outlook 2003 which combines text from messages
found in specific public folders into a new message which is placed in the
user's designated folder (typically Drafts). The user is expected to
view/edit the resultant message and then send it. The customer wants the
sender of the message to be the email address of the public folder. I have
tried setting SendOnBehalfOf to that email address. It shows up when the
user edits the message, but when Outlook sends it, it is replaced by the
users name/email address.

I believe this is because once the message has been saved, the MAPI sender
object is locked in, hence it contains the user's email address that ran the
Addin.

My question: Is there some way to save this message with the desired email
name/address so that when it is sent, it arrives looking like it came from
the public folder.

I have even tried having the sender manually change the From line before
sending... it appears to change, but gets replaced once Outlook sends the
message.

Help please!
 
S

Sue Mosher [MVP-Outlook]

SentOnBehalfOf would be the right property. Does the user have SendAs rights over the public folder, though?
 
R

rschisler

Hi Sue,

Thanks for the reply. The user does have the sendas rights for the folder,
but in experimenting I discovered some additional information and also a
work-around:

One thing I didn't mention in my original post is that while my add-in
creates the message in the user's Drafts folder, it immediately moves it to
another public folder "Tokyo_Drafts". My customer wants his users to be able
to see and possibly edit the final message before it is sent. When you look
at the message in the public folder, the sender information looks correct
(ie. it has the name of the public folder the customer want in the "From"
line) but if a user actually sends the message from the public folder, the
"From" line on the message is ignored and replaced by the user's own email
address. If the user copies the message to his local Drafts folder and sends
it, it works.

My work-around is that I have created a second COM Add-In. When the user is
ready to actually send the message, it creates a new message, copies all the
elements from the one in the public folder (recipients, body, etc.) and
reapplies the "SendOnBehalfOfName" and does the "send". It also deletes the
message in the Tokyo_Drafts pubic folder. If the send fails for any reason,
the message is then saved in the users local Drafts folder so he can fix the
problem and resend it.

So all in all it would be nice to find a way to avoid having the user move
the message before sending or use the second add-in, but at least I have a
solution for the customer.

Thanks
Rich Schisler
 

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