Outlook Mail - Can you change the Sender property?

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Mail - Can you change the Sender property?
 
Myles Wakeham




Posts: 42
Joined: 2005-05-11
I'm trying to work out if in Outlook 2003 there is anyway to set the MailItem.Sender property. From what I can see this is a read-only property but I can set the SendonBehalfOfName but I'm not sure I like the end result emails that are created with this technique.

Any pointers on this would be greatly appreciated.

Regards,
Myles
Posted 30 Nov, 2005 13:21:55 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Myles,

Yes you are right, the SenderName and SenderEmailAddress properties are read-only. Can you please describe what final result of email you need?


Posted 01 Dec, 2005 07:37:24 Top
Myles Wakeham




Posts: 42
Joined: 2005-05-11
I am creating emails in Outlook through the AddInexpress component in Delphi 7. I can create emails, update their properties, etc. and send them. But I need to be able to create them so that they come from different 'From' addresses. The only property I have access to, to change this is the 'SendonBehalfofName' property, which only changes some of the From information. The problem is that even with changing this, it doesn't change the email address that replies are set to so its not really a solution to my problem.

I've scoured the web and found that some people have been able to do this with ExtendedMAPI or CDO, but I have no idea what is involved in this. If I could find some sample code that demonstrates it, I would be able to work with it. But no luck in finding Delphi code for this. There are some VB examples, but I can't really work out how to translate this over.

Any ideas?

Myles
Posted 01 Dec, 2005 10:24:44 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Myles,

I know VB a little, so you can contact me directly by email, I will try to help you to translate the examples in Delphi.

Posted 01 Dec, 2005 11:17:48 Top
Gerrit Visser




Posts: 3
Joined: 2005-12-02
Hi Myles
I looked around for some time to accomplish the same thing. In the end I gave up for now :-) e.g. I don't want to have access to othter's email boxes, which is what they would need to provide at least Create Items permission to their Outbox. You can see what this entails by looking at Outlook/File/xxxxProperties/Permssions where xxx is Inbox, or Outbox, etc. You could experiemnt with getting someone to give you only Create Items permission so that you can author and send an email, but you couldn't see their incoming emails (privacy, etc.)

Basically, you can't send on behalf of other users without their permission, that would create a serious issue. I found this article in msdn, http://support.microsoft.com/kb/q232309/ which explains the restrictions and approach.
Here is an example of using CDO to accomplish the task (given the restrictions above that you must have been given permission by the owner of the email address), http://www.cdolive.com/cdo5.htm#MessageOriginator. You can accomplish the same using just the Outlook mailitem SentOnBehalfOf property. (I haven't actually tried this myself, for my Report distributor I set the Reply To so that replies and comments about the report go to the report 'owner', not me. The exception is that bounces come back to me in spite of setting the ReplyTo)
Posted 05 Dec, 2005 09:30:34 Top