Outlook Email - Setting the Reply To property?

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

Outlook Email - Setting the Reply To property?
 
Myles Wakeham




Posts: 42
Joined: 2005-05-11
Is there a specific way to set the Reply-To property of a MailItem in Outlook through Add-In Express? I can't seem to see the property of it in Delphi, but I may be looking in the wrong place.

Myles
Posted 30 Nov, 2005 13:23:04 Top
Dmitry Kostochko


Add-in Express team


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

I can't find the property with the name ReplyTo. Please specify what property do you mean?

Posted 01 Dec, 2005 07:45:08 Top
Myles Wakeham




Posts: 42
Joined: 2005-05-11
In pure SMTP emails, the 'From' address and the 'ReplyTo' addresses of an email are totally seperate fields. The From address is what shows in the header as the originator of the email, but the ReplyTo is the address that comes up when a user clicks 'Reply' to the email.

From what I can see of Outlook it supports this, but doesn't make the ReplyTo email address accessible. You certainly can set this when you create an account in Outlook, but it is so non-standard in comparison with standard SMTP mail properties that I'm surprised I can't change this on an email by email basis.

Any ideas?

Myles
Posted 01 Dec, 2005 10:27:08 Top
Dmitry Kostochko


Add-in Express team


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

Thank you for the explanation.
I think you can try to use the ReplyRecipients property of the MailItem interface or try to use the solution from the OutlookCode web-site:
http://www.outlookcode.com/d/code/getsenderaddy.htm#replyto

Posted 01 Dec, 2005 11:15:31 Top
Myles Wakeham




Posts: 42
Joined: 2005-05-11
That looks like it will let me read the property, but I want to set it. I believe that its still a read/only property regardless.

Myles
Posted 01 Dec, 2005 11:26:30 Top
Dmitry Kostochko


Add-in Express team


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

Why read-only? The ReplyRecipients is a collection in which you can add recipients when creating a new e-mail message.

Posted 01 Dec, 2005 11:55:19 Top
Gerrit Visser




Posts: 3
Joined: 2005-12-02
Hi
Solution is:
Dim osMailItem As MailItem
Dim oRecipients As Recipients
Dim oRecipient As Recipient

Set osMailItem = oOutlook.CreateItem(olMailItem)
Set oRecipients = osMailItem.ReplyRecipients
Set oRecipient = oRecipients.Add(sOwner)
oRecipient.Type = olTo

ReplyRecipients is a collection since you can set the ReplyTo in the email option box to one or more email addresses.

Gerrit
Posted 02 Dec, 2005 10:39:29 Top
Dmitry Kostochko


Add-in Express team


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

Thank you for the code snippet.

Posted 05 Dec, 2005 07:53:55 Top