Setting the sender property of the message in CDO

Setting the sender property of the message in CDO

Post by Czar Eclarina » Thu, 29 Mar 2001 15:36:42



How can I change the sender property of a message? This code doesn't seem to work.

Set objNewMessage = objMessage.CopyTo(objSession.getDefaultFolder(2).ID)
objNewMessage.Sent = False
objNewMessage.Update
Set objNewMessage.Sender = objSession.CurrentUser
objNewMessage.Update
objNewMessage.Send

 
 
 

Setting the sender property of the message in CDO

Post by Siegfried Weber [MVP-Exchange » Thu, 29 Mar 2001 16:13:05



> How can I change the sender property of a message? This code doesn't seem

to work.

You cannot change the sender after the message has been saved with .Update.
Try:

Set objNewMessage = objMessage.CopyTo(objSession.getDefaultFolder(2).ID)
Set objNewMessage.Sender = objSession.CurrentUser
objNewMessage.Update
objNewMessage.Send

If this doesn't work try to create a new message and set the sender before
sending it.

--
Siegfried Weber

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Messaging and Collaboration
Application Development
http://www.cdolive.com

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice - filter active.

 
 
 

1. how to set the sender for a message

I am using CDO here. The steps I took are:
log onto my mailbox
create a message in outbox
set the subject, txt, etc.
Send message.

Everything is fine except that in configuring the message, I want to set the
sender to be something other than myself. How can I do that? You can't
create an AddressEntry object out of blue. I tried to do
AddressEntryPtr pSender = pMessage->Sender

but I got a COM error saying MAPI_E_NOT_FOUND, suspect this has to do with
the fact that Sender property does not correspond to any MAPI property.

How can I set the sender for the message that's going out?

Thanks!
Xingcheng

2. HALO IS ONLINE

3. Setting sender name in an email message

4. Are compilers really smart code optimizers?

5. CDO message.text property truncates with Euro characters ??

6. Does any P/PC have PC slots

7. CDO Win2K - How to set message priority?

8. Pocket Modem, model P1496MX question!

9. CDO 1.2.1 Mapi.Session GetMessage.Sender - in VB .net unauthorized access exception

10. changing the sender using cdo

11. CDO - AppointmentItem sender?

12. Setting some embedded message properties

13. MAPI Sender properties