In Exchange 2013, I have generated an email using EmailMessage object. I save this message in the Drafts folder and get an ID back from the save method. I then load the email message from the drafts folder by binding and from the message I compose an URL to the email created using "WebClientReadFormQueryString" property. I can then direct the user to the OWA popup with this email loaded.
Now that we migrated to Exchange 2016, the popup doesn't get loaded. The email generated can be seen in drafts folder. I want it to automatically display the OWA popup with the draft email loaded. (same behaviour as Exchange 2013).
Thanks in advance.
See the Version differences section of the official Microsoft documentation on WebClientReadFormQueryString
Versions of Exchange starting with major version 15 and ending with Exchange Server 2013 build 15.0.775.38 (CU3) and Exchange Online version 15.00.0775.009 do not return a correct query string fragment in the WebClientReadFormQueryString element.
In versions of Exchange earlier than major version 15, the item identifier for the Outlook Web App URLs is an Outlook Web App identifier. If you are targeting a version of Exchange earlier than major version 15, you have to use the ConvertId operation to convert the identifier.
You might need to do something like this in your code:
// Versions of Exchange starting with major version 15 and ending with Exchange Server 2013 build 15.0.775.09
// returned a different query string fragment. This optional check is not required for applications that
// target Exchange Online.
if ((serverInfo.MajorVersion == 15) && (serverInfo.MajorBuildNumber < 775) &&(serverInfo.MinorBuildNumber < 09))
{
// If your client is connected to an Exchange 2013 server that has not been updated to CU3,
// this query string will be returned.
owaReadFormQueryString = string.Format("#viewmodel=_y.$Ep&ItemID={0}",
System.Web.HttpUtility.UrlEncode(ewsIdentifer, Encoding.UTF8));
}
else
{
// If your client is connected to an Exchanger 2010, Exchange 2013 CU3, or Exchange Online server,
// the WebClientReadFormQueryString is used.
owaReadFormQueryString = msg.WebClientReadFormQueryString;
}
// Create the URL that Outlook Web App uses to open the email message.
Uri url = service.Url;
string owaReadAccessUrl = string.Format("{0}://{1}/owa/{2}",
url.Scheme, url.Host, owaReadFormQueryString);
if (!string.IsNullOrEmpty(owaReadAccessUrl))
{
System.Diagnostics.Process.Start("IEXPLORE.EXE", owaReadAccessUrl);
}