Possible to modify Return-Path in code?

  • Thread starter Thread starter joebob
  • Start date Start date
J

joebob

I set my From header in code using CDO and Redemption. Does anyone know
if there is a way to set the Return-Path in code also? I want to make
it match the From address. This is for O2K SP3 in C/W mode, no Exchange
Server. Thanks
 
Yes, that's exactly what I did. Is that supposed to alter the Return-Path as well as the From field? Here's my code:

Set oItem = Application.CreateItem(olMailItem)
Set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = oItem
Tag = sItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "From")
Tag = Tag Or &H1E 'the type is PT_STRING8
sItem.Fields(Tag) = "Someone <[email protected]>"
sItem.Subject = sItem.Subject 'to trick Outlook into thinking that something has changed
sItem.Recipients.Add "(e-mail address removed)"
sItem.Send
 
Yes, if you specify "Return-Path" instead of "From" in a call to
sItem.GetIDsFromNames().

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Yes, that's exactly what I did. Is that supposed to alter the Return-Path
as well as the From field? Here's my code:

Set oItem = Application.CreateItem(olMailItem)
Set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = oItem
Tag = sItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}",
"From")
Tag = Tag Or &H1E 'the type is PT_STRING8
sItem.Fields(Tag) = "Someone <[email protected]>"
sItem.Subject = sItem.Subject 'to trick Outlook into thinking that something
has changed
sItem.Recipients.Add "(e-mail address removed)"
sItem.Send
 
I tried that, specifying "Return-Path" instead of "From", and specifying just "Return-Path", and it has no effect. Any other ideas? Thanks
 
Sorry, I misstated that. What I meant was that I tried specifying "Return-Path" plus "From", and "Return-Path" instead of "From", and it made no difference.

I tried that, specifying "Return-Path" instead of "From", and specifying just "Return-Path", and it has no effect. Any other ideas? Thanks
 
Hmmm... In my experiment "Return-Path" was inserted, but the problem is
Outlook (or Exchnage) added its own value to the top of the message headers
anyway...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Sorry, I misstated that. What I meant was that I tried specifying
"Return-Path" plus "From", and "Return-Path" instead of "From", and it made
no difference.

I tried that, specifying "Return-Path" instead of "From", and specifying
just "Return-Path", and it has no effect. Any other ideas? Thanks
 
Back
Top