Subscribe to Windows IT Pro
March 25, 2002 12:00 AM

Finding Redemption

Windows IT Pro
InstantDoc ID #24411
Rating: (3)
Downloads
24411.zip

Obtaining the sender's address is complicated because you need to consider both Internet senders and internal Exchange senders. As I explained in "Using Collaboration Data Objects," http://www.winnetmag.com, InstantDoc ID 24392, you can retrieve an Exchange sender's SMTP address as a property of the AddressEntry object with Collaboration Data Objects (CDO). However, CDO in Outlook 2002 is subject to the same security prompts as Outlook, so you need to use Redemption to get a "safe" AddressEntry object.

Redemption includes a Fields collection that lets you access MAPI properties that provide information you can't get from Outlook object-model properties. In Listing 2, the R_GetSenderAddress() function declares two constants corresponding to the property tags that identify different MAPI properties, then obtains the values of those properties from the Fields collection. For example, the statement at callout A in Listing 2 sets the value of a string variable to the sender's address type (e.g., SMTP, EX).

Redemption adds to its SafeMailItem the Sender property, which the Outlook MailItem doesn't have. This property returns a SafeAddressEntry object, which is analogous to the AddressEntry object in CDO. Although Sender has a few useful properties of its own (e.g., Address), you might need to use its Fields collection to dig deeper into the properties. For example, at callout B in Listing 2, the R_GetSenderAddress() routine uses the Fields collection from the sender (which the objSenderAE object represents) to return the SMTP email address for the Exchange sender.

You can place the code in Listing 2 either in the ThisOutlookSession module or in a separate module and use the R_GetSenderAddress() function any time you want to get the address of a sender without displaying Outlook security prompts.

How does Microsoft feel about Redemption? I haven't seen any official opinion, but individuals at Microsoft have pointed out that it makes Outlook less secure. They're absolutely right about that. Redemption is scriptable; therefore, malicious VBScript code could use it. One way to make it more secure is to rename the Redemption.dll file to something a hacker isn't likely to guess, like r8gh36.dll. A script then would need to know the new name and use it to create Redemption objects, as in

Set objSafeMail =
  CreateObject _
  ("r8gh36.SafeMailItem")

If you already have strong protection against viruses and find that the programming restrictions introduced with the Outlook Email Security Update are hurting your productivity, Redemption provides an easy-to-use solution.

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Aug 10, 2005

    I'd like to see the sender e-mail address (rather than just name). I am a VBA beginning. I tried pasting Listing1 into ThisOutlookSession but nothing has happened. What exactly must one do to 'install' this script? I'd like to see the sender e-mail address for (i) incoming mail and also (ii) sent mail, and would like to be able to (iii) sort by sender e-mail address (which you often cannot do for derived fields).
    THANKS FOR ANY ASSISTANCE!!

  • Anonymous User
    7 years ago
    Feb 25, 2005

    Did not work for me. I still got the warning when trying to access the recipients:

    Set myinspector = CreateObject("Redemption.SafeInspector")
    myinspector.Item = Outlook.Application.ActiveInspector
    Set Recipients = myinspector.CurrentItem.Recipients

  • mal4mac
    8 years ago
    Sep 17, 2004

    For an alternative to redemption, check out:

    http://www.321books.co.uk/ebooks/outlook-vba-tutorial.htm

  • Tom Groszko
    9 years ago
    Dec 08, 2003

    I am gettin nowhere using Redemption with an existing C++ application. Can't find any current docs on what extended MAPI I need to get around the pop-up. Does anybody have C++ code for Redemption or Extended MAPI to get around this problem.

    Thanks

  • buechel
    9 years ago
    Nov 10, 2003

    thanks, but it don't work. outlook crashes on send safemail :(

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.