Re: Redemption, Help with selecting E-mail Account



Using the x-header trick or using RDOMail.Account are roughly equivalent.

I'd concentrate on getting what you have to work though, unless you do any alternate code would probably also fail.

What's the answer to Dmitry's question? He's the expert in Redemption, after all he wrote it. I've just used it every day for the last 6 years or so, so his help in this will be invaluable.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sean" <seanryanie@xxxxxxxxxxx> wrote in message news:96ab1519-7037-4f3c-81ee-bdd1b019e464@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ken, when I right click on debug message, it shows Mapiutils under
classes and I can see MAPIIOBJECT under members, although don't know
what all that means

I declared what you said as
Dim NameSpace As Object
Dim RDOSession As Object

But it debugs with the exact same message.

I've looked at the Redemption site and under FAQ # 14 it seems to do
exactly what I want my means of "hard coding" a From name and addy,
the text of it is below, but how would I incorporate that to twaek my
code, on the assumption that I can't get above to work

Is there any way I can select an account to be used for sending a
message with Redemption?

Generally speaking, no. If you look at the message sent using non-
default account using OutlookSpy, you will notice that Outlooks sets a
couple of named properties; one of them is the name of the account,
another one is a combination of the account integer index and its
name. The format is not documented of course.

The good news however is that you can do much better than just
selecting an account: you can set the sender name and address to an
arbitrary value, you do not need to have an account configured with
that name and address. The trick is based on the fact that you can add
a named property with a particular GUID to an outgoing message and
force Outlook to use the name of the property as an RC822 header and
its value as the value of the header. By adding a property with the
name "From" and the value in the form "Someone <whoever@xxxxxxxxxx>"
you add an RF822 header:

From: Someone <whoever@xxxxxxxxxx>

Both Exchange and IMAIL providers are smart enough to replace an
existing header if one exists, i.e. you will not get two "From"
headers. The only limitation is that the message must be converted to
the RFC822 format along the way, it will not work if the message is
sent between two mailboxes on the same Exchange server. The message in
your Sent Items folder will still have the default sender name, but
the recipients will see the new value. Whether you use IMAIL (POP3/
SMTP) or Exchange provider in Outlook to send a message, doesn't
matter at all, it will work in both cases.

set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = MailItem
tag = sItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}",
"From")
tag = tag or &H1E 'the type is PT_STRING8
sItem.Fields(Tag) = "Someone <whoever@xxxxxxxxxx>"
sItem.Subject = sItem.Subject 'to trick Outlook into thinking that
something has changed
sItem.Save



.



Relevant Pages

  • Re: Redemption, Help with selecting E-mail Account
    ... Is there any way I can select an account to be used for sending a ... couple of named properties; one of them is the name of the account, ... its value as the value of the header. ... SMTP) or Exchange provider in Outlook to send a message, ...
    (microsoft.public.outlook.program_vba)
  • Re: How do I Bounce Mail from Outlook?
    ... I need to know how I bounce mail from my Outlook account ... ... You might even leave the From header pointing at your original ... receiving mailbox but use the Reply-To header to have recipients send ...
    (microsoft.public.outlook.general)
  • Re: How do I Bounce Mail from Outlook?
    ... It is another outlook account that doesn't run from our server. ... You might even leave the From header pointing at your original ...
    (microsoft.public.outlook.general)
  • Re: Change default user name header
    ... The header line will always use the default account name. ... Diane Poremsky [MVP - Outlook] ... e-mail accounts and puts all input in one IN-box where I can read and answer. ...
    (microsoft.public.outlook.installation)
  • Re: disable default account
    ... I don't believe that you can make outlook to ask you. ... trick that I use (ok... ... just common sense actually) is that my default ... account is an account that I just made up so ...
    (microsoft.public.outlook)