web 2.0


Using "Redemption" to send a safe Outlook message

This short tip shows how to use Redemption’s SafeOutlook Library to send e-mail messages without that annoyance of the security warning for Outlook. You can also use Redemption to create other safe Outlook objects...

To use this code you will need to download the Redemption dll and install on your PC. You can download it from http://www.dimastr.com/redemption/redemption.zip. After installation, you should do the following:

1.       On the VBE, go to Tool à References and from the list install the references for SafeOutlook Library

2.       On the VBE, go to Tool à References and from the list install the references for Microsoft Outlook X.x Object Library (where “X.x” indicates the version of your Outlook)

With all that sorted out, we are ready for the code:
 

 

Sub sendMailThroughRedempetion()

    Dim appOL               As Outlook.Application
    Dim myEmail             As Outlook.MailItem
    Dim mySafeEmail         As Redemption.SafeMailItem

    Set appOL = CreateObject("Outlook.Application")
    Set myEmail = appOL.CreateItem(olMailItem)
    Set mySafeEmail = CreateObject("Redemption.SafeMailItem")

    With mySafeEmail
        .Item = myEmail
        .Recipients.Add "someone@somewhere.com"
        .Recipients.ResolveAll
        .Subject = "My test redemption message"
        .Body = "Body of my message"
        .Send
    End With
End Sub

Tags: , ,

Microsoft Outlook | Microsoft Outlook - VBA

Comments are closed