user1194439
user1194439

Reputation: 143

Link to specific email in Exchange 2010 (EWS)

We have a web application that links to an exchange account and shows a list of all emails relating to that specific customer. When you click on an email in the list then that specific email opens in a new window in OWA.

We have just been upgraded to Exchange 2010 and I was pleased to find that all this code needed to be rewritten as WebDav has been deprecated! I've got everything working so far except opening the email. This is an example of the URL I get when opening one manually:

https://owa.example.com/owa/?ae=Item&a=Open&t=IPM.Note&id=RgAAAADmf6EZfqbORr1%2fiveFFYyBBwDf6W1FdO8tR59JIuH4tblWAAABcKsWAAAT7QzqtNGiR6C1Ogbnj0IjAAAAA050AAAA&pspid=_1328545178425_761458089

The problem is that I don't know how to get the last parameter (pspid). Does anyone know what this is? I'm starting to think it might be a security token for the session as opposed to part of the email. Does anyone know know the best way to generate a link like this?

Thanks

Upvotes: 1

Views: 1478

Answers (1)

user1194439
user1194439

Reputation: 143

It took about a day to find the answer so I hope this helps someone. I needed to convert to the OwaId.

//Get the OWA Id
    public String GetOutlookOwaId(EmailMessage message, ExchangeService ser)
    {
        AlternateId ewsId = new AlternateId(IdFormat.EwsId, message.Id.ToString(), "[email protected]");
        AlternateIdBase owaId = ser.ConvertId(ewsId, IdFormat.OwaId);
        return ((AlternateId)owaId).UniqueId;
    }  

Upvotes: 1

Related Questions