How to convert each Microsoft.Graph.Models.Message object from emailbox to EML file using C#?
For me, I use the code bellow.
var mc = gsc.Users[primaryMail].Messages[item.Id].Content.GetAsync().GetAwaiter().GetResult();
using (var fs = new FileStream(filepath + Path.DirectorySeparatorChar.ToString() + curFileName, FileMode.Create, FileAccess.Write))
{
mc?.CopyTo(fs);
}
ret = true;
Thread.Sleep(1500);