Using Redemption to modify 'From' field

N

Nic Harding

Hello,

I am trying to modify the 'From' field of outgoing emails. I am using
WinXP, programming with vb6, running Outlook 2003 and Redemption 3.4
..I have read some previous posts on this subject and also the
information on the Redemption site. When I send an email with a
modifyed 'From' address it comes back to me displayed as follows:

<Original Email Address> on behalf of <My New Email Address>

Why does'nt the 'From' field display the "New Email Address" ONLY,
with NO 'on behalf of' included?

Below is a snippet of my email code I have written:

Function SendEMail(sEmailTo As String, sSubject As String, sPath As
String)
Dim oOutlook As Outlook.Application
Dim oMAPI As Outlook.NameSpace
Dim oFolder As Outlook.MAPIFolder
Dim oMailItem As Outlook.MailItem
Dim oRecipient As Outlook.Recipient
Dim oFSO As Scripting.FileSystemObject

'Redemption
Dim oRED_MailItem As Redemption.SafeMailItem
Set oRED_MailItem = New Redemption.SafeMailItem

' Create an instance of an Outlook Application
Set oOutlook = New Outlook.Application
If Not oOutlook Is Nothing Then

' Get the MAPI NameSpace object
Set oMAPI = oOutlook.Session
If Not oMAPI Is Nothing Then

' Log in to the MAPI session
oMAPI.Logon , , True, True

' Create a pointer to the Outbox folder
Set oFolder = oMAPI.GetDefaultFolder(olFolderOutbox)
If Not oFolder Is Nothing Then

Set oMailItem = oFolder.Items.Add(olMailItem)
If Not oMailItem Is Nothing Then
With oMailItem
Set oFSO = New Scripting.FileSystemObject

.BodyFormat = olFormatHTML
.Subject = sSubject
.HTMLBody = oFSO.OpenTextFile(sPath).ReadAll()
.To = sEmailTo

'Redemption
Dim Tag As Variant
oRED_MailItem.Item = oMailItem
Tag =
oRED_MailItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}",
"From")
Tag = Tag Or (&H1E) 'the type is PT_STRING8
oRED_MailItem.Fields(Tag) = "MyNewEmail
<[email protected]>"
oRED_MailItem.Subject = oRED_MailItem.Subject
'to trick Outlook into thinking that something has changed
oRED_MailItem.Save
oRED_MailItem.Send

'Programatically click send/reveive
Dim oCtl As Office.CommandBarControl
Dim oCB As Office.CommandBar
Set oCtl =
Application.ActiveExplorer.CommandBars.FindControl(1, 7095)
oCtl.Execute
Set oCtl = Nothing
Set oCB = Nothing

Set oFSO = Nothing
Set oMailItem = Nothing
End With
End If
Set oFolder = Nothing ...........

Thanks in advance for any help.
Nic Harding.
 
N

Nic Harding

Hello Dmitry ,

I am using standard pop/smtp, not Exchange.

Regards, Nic Harding.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

Dmitry Streblechenko \(MVP\)

Hmmm... How do the RFC822 headers look like on the received message
(RMB|Options|Internet Headers) or PR_TRANSPORT_MESSAGE_HEADERS in Extended
MAPI?

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

Nic Harding

Dmitry, here are the Internet Headers that you asked for from my
recieved email;

Status: R
Return-path: <[email protected]>
Received: from mta16ps.bigpond.com ([192.168.114.143])
by mailms5aps.email.bigpond.com
(iPlanet Messaging Server 5.2 HotFix 1.26 (built Mar 31 2004))
with ESMTP id <[email protected]> for
(e-mail address removed); Thu, 08 Jul 2004 22:50:24 +1000 (EST)
Received: from cofe-daemon.mta16ps.email.bigpond.com by
mta16ps.email.bigpond.com
(iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003))
id <[email protected]> for (e-mail address removed)
(ORCPT (e-mail address removed)); Thu, 08 Jul 2004 22:50:24 +1000 (EST)
Received: from tbf-daemon.mta16ps.email.bigpond.com by
mta16ps.email.bigpond.com
(iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003))
id <[email protected]> for (e-mail address removed);
Thu,
08 Jul 2004 22:50:21 +1000 (EST)
Received: from gizmo61ps.bigpond.com ([144.140.71.35])
by mta16ps.email.bigpond.com
(iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003))
with SMTP id <[email protected]> for
(e-mail address removed); Thu, 08 Jul 2004 22:50:21 +1000 (EST)
Received: (qmail 2430 invoked from network); Thu, 08 Jul 2004 12:50:20
+0000
Received: from unknown (HELO psmam12.bigpond.com) (144.135.25.103)
by 144.140.71.35 with SMTP; Thu, 08 Jul 2004 12:50:20 +0000
Received: from cpe-144-136-205-102.sa.bigpond.net.au ([144.136.205.102])
by psmam12.bigpond.com(MAM REL_3_4_2a 234/12511150)
with SMTP id 12511150; Thu, 08 Jul 2004 22:50:20 +1000
Date: Thu, 08 Jul 2004 22:20:28 +0930
From: itsme <[email protected]>, Nic Harding <[email protected]>
Subject: Calico Bag Offer - $2 each
Sender: Nic Harding <[email protected]>
To: (e-mail address removed)
Message-id: <[email protected]>
MIME-version: 1.0
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Mailer: Microsoft Office Outlook, Build 11.0.5510
Content-type: multipart/alternative;
boundary="----=_NextPart_000_0000_01C46539.C694D380"
Original-recipient: rfc822;[email protected]

Thanks for helping.
Nic Harding


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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