Changing the RFC822 header of a SafeMailItem using Redemption

F

FLudewig

Hi,

I am using redemption in my application to send e-mails from a non-default
account in Outlook. Since Redemption does generaly not allow sending from
non-default account I tried the workaround described in the redemption FAQ: I
add a named property ("From") to the outgoing message and force Outlook to
use its name as RFC822 header and its value as the value of the header.

This works fine in my machine but it won't on others. Here is my code:

Set oOutlook = GetObject(, "Outlook.Application")

'open Session
Set oSession = New Redemption.RDOSession
oSession.Logon

Set oItem = oOutlook.CreateItem(olMailItem)
Set oSafeMailItem = New Redemption.SafeMailItem
With oSafeMailItem
.Item = oItem

Tag = .GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "From")
.Fields(Tag) = "Someone <[email protected]>"
.Subject = .Subject 'to trick Outlook into thinking that something has
changed
.Save
end with

Any ideas? Is it the GUID maybe?

Thanks for your help!
F. Ludewig
 
K

Ken Slovak - [MVP - Outlook]

It looks like you forgot the line where you OR the tag with the value for
PT_STRING8. That's totally necessary. I'm surprised it works at all without
that.
 

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