We have used Microsoft azure for our upload and download file functionality. We are able to successfully upload and download files, the issue is with mail items. We are able to upload and download .msg file, when we try to open it, its giving the error "we can't open the item". The code is not breaking anywhere so its difficult to find the issue. Any help would be really helpful.
converting the byte array to mail item
if (data != null) //this is the data from azure
{
HttpResponse response = HttpContext.Current.Response;
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + filename);
Response.AddHeader("Content-Length", data.Length.ToString());
Response.BinaryWrite(data);
Response.Flush();
}