c# - Email Message save to Local Folder through EWS -


I am using this method to save email messages locally and if there is an attachment with email, then it works fine.

  _emailMessage.Load (new propertySat (methicemma. Mimecontent)); MimeContent MC = _emailMessage.MimeContent; Var path = path Combine (diffulpath, email mjnem); File stream fs = new filestream (path, create file mode); Fs.Write (mc.Content, 0, mc.Content.Length); Fs.Close ();   

If there is no attachment, it throws an exception and is not able to save the email message to the folder. There is an exception "This operation can not be performed because this service object has no ID."

Please tell me how to deal with this problem.

Thanks

Perhaps some code path does not use email messages. Save or email message. Weight

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -