Skip to content

Problem with EmailMessage.Update #447

@JuanMurciaN

Description

@JuanMurciaN

Library is not able to update an EmailMessage Body

The following code will work on C# to change the body of an email

ExchangeService ewsClient; // A properly authenticated EWS service object tied to a mailbox
string emailID; // A valid email ID for that mailbox

var message = EmailMessage.Bind(ewsClient, new ItemId(emailID));
message.Body = new MessageBody(0, "<p>This is the replaced body</p>");

message.Update(ConflictResolutionMode.AlwaysOverwrite);

In the other hand, it's equivalent on javascrypt throws Exception: The request failed schema validation.

const ewsClient: ExchangeService; // A properly authenticated EWS service object tied to a mailbox
const emailID: string; // A valid email ID for that mailbox

const message = await EmailMessage.Bind(ewsClient, new ItemId(emailID));
message.Body = new MessageBody(0,'<p>This is the replaced body</p>');

await message.Update(ConflictResolutionMode.AlwaysOverwrite);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions