Search code examples
c#outlook-redemption

Attempting to return MailTips using Redemption


Screen Shot

I'm attempting to return Mailtips(GetMailTips function) for a given Exchange user as pictured in the screen shot above. I'm stuck at the highlighted intellisense section.

Here's my code-

// Using redemption to return mail tips
string mailTip = "";
session.MAPIOBJECT = Application.Session.MAPIOBJECT; 
Redemption.RDOAddressEntry addressEntry = session.AddressBook.GAL.ResolveName("Joe Flick");
//Here I'm attempting to get the mail tips
mailTip = addressEntry.    // I would expect to see the GetMailTips Method/Fuction here but I don't see it

I'm attempting to translate this VB -

Added RDOAddressEntry.GetMailTips method that allows to retrieve Out-Of-Office text, max message size, etc. for an Exchange mailbox. See RDOMailTips object for more information.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
Session.SkipAutodiscoverLookupInAD = true
set AdrEntry = Session.AddressBook.ResolveName("user@domain.demo")
set mailTips = AdrEntry.GetMailTips("me@domain.demo", "<My Password>")        optional authentication parameters for EWS
MsgBox mailTips.MaxMessageSize

Detailed here -

I can't seem to get the proper syntax down as commented in the code above but can resolve the username against the GAL fine. Any help is appreciated. Thanks in advance!

![Visual Studio Screen Shot][3]


Solution

  • OK, I was able to return the Mailtips once I downloaded the evaluation .dll from dimastr.com. My goal here was to check to see if a conference room was restricted or not.

    Redemption.RDOSession session = new Redemption.RDOSession();
    session.MAPIOBJECT = Application.Session.MAPIOBJECT;
    Redemption.RDOAddressEntry addressEntry = session.AddressBook.GAL.ResolveName("User Name From the GAL");
    try
    {
    Redemption.RDOMailTips mailtips = addressEntry.GetMailTips();
    MessageBox.Show(mailtips.DeliveryRestricted.ToString());
    MessageBox.Show(mailtips.CustomMailTip.ToString()); 
    }
    catch (NullReferenceException ex)
    {
    MessageBox.Show(ex.ToString());
    }