Getting error while editing Body of MapiMessage

I am getting error “Valid values are between 0 and 65535, inclusive.\r\nParameter name: codepage” while editing body of MapiMessage. I have set the body property using SetProperty method which is successful. After it I want to edit property using Body attribute but getting this exception.

Stack trace
at System.Text.Encoding.GetEncoding(Int32 codepage)
at #=zWJ9$UCARMZYP1W22mnjvZLcQSHpL.#=zgtDnvw4=(Int32 #=zw1QjV4dYsD66wdLnlg==)
at Aspose.Email.Mapi.MapiMessageItemBase.get_BodyType()
at #=zQNs9zG_gKDfi_Cv5XOyPoc8=.#=zcQntOMu_PFM7(MapiMessageItemBase #=zTBm4fO8=, String #=zJlmDJWB3TlAD)
at #=zQNs9zG_gKDfi_Cv5XOyPoc8=.#=zHKRZXF5YJ34k(MapiMessageItemBase #=zTBm4fO8=)
at Aspose.Email.Mapi.MapiMessageItemBase.SetBodyContent(String content, BodyContentType contentType, Boolean compression)
at Aspose.Email.Mapi.MapiMessageItemBase.SetBodyContent(String content, BodyContentType contentType)
at Aspose.Email.Mapi.MapiMessageItemBase.set_Body(String value)

@ksem,

Can you, please, provide us with the code sample and the message file if the problem appears with a certain file. They are necessary to reproduce the bug.

Thank you.

I am getting this for all messages. Is there any way I can share the object in a serialized format with you.

@ksem,

Can you, please, save the MapiMessage to a file, zip it up and upload it here to the forum. Also, to help you with your problem, we need the code sample that you use for setting the body property and editing the body.

Thank you.

No longer a issue. Thanks for your help.

@ksem,

We are happy you could make it work. Thanks for writing to Aspose support.