Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


March 25, 2002

Finding Redemption


RSS
Subscribe to Windows IT Pro | See More Visual Basic (VB) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

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.

End of Article

   Previous  1  [2]  Next  


Reader Comments
I discovered another use for Redemption. I was using CDO to obtain the sender's email address from the internet header of an incoming email. But this caused me hassles with distributing my application because there were different CDO's for windows 9x and windows NT - the only instance of this I've personally come across. With Redemption - no hassle - one library all windows operating systems.

Andrew Chester May 09, 2002


Can you please help me with the AsArray method to convert the attachments into an array.
An example would be great.
Thanks.

Gautam Adlakha November 05, 2003


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

buechel November 10, 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


Tom Groszko December 08, 2003


For an alternative to redemption, check out:

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



mal4mac September 17, 2004 (Article Rating: )


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

Anonymous User February 25, 2005 (Article Rating: )


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 August 10, 2005 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Exchange Server and Outlook Whitepapers Email Controls and Regulatory Compliance

Take Control of Your Email: Understand the Business Reasons for Email Storage Management

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Bail Out Your Exchange Environment

Check out our list of Free Email Newsletters!

Exchange Server and Outlook eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

The Expert's Guide for Exchange 2003: Preparing for, Moving to, and Supporting Exchange Server 2003

Related Exchange Server and Outlook Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format

Exchange & Outlook UPDATE eNewsletter
News, strategies, products, and developments in Exchange Server and Outlook messaging.

Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement