Hi,
I am trying to send a message using the C# graph api client using the following code...
var draft = await client.Me.Messages
.Request()
.AddAsync(message);
await client.Me.Messages[draft.Id]
.Send()
.Request()
.PostAsync();
Attachments are added is this way, where file is a
file in memory.
message.Attachments.Add(new FileAttachment
{
ContentBytes = file.Content,
ContentType = file.ContentType,
ContentId = file.Id.ToString(),
Name = file.Name,
IsInline = false
});
But I keep getting this error when attachment is eg. a pdf file. It works fine for emails without attachments or with eg. .png files attached.
Status Code: BadRequest
Microsoft.Graph.ServiceException: Code: ErrorUnsupportedTypeForConversion
Message: Unsupported type for restriction conversion.
Any help would be appreciated :)