Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
since a few weeks, whitout any code change for the past year, mails send using the Graph API received as spam, sending the identical message (identical subject, body, attachments) via outlook to the identical recipient are received normaly.
Hope you can help us out with this one
grtz,
Luc
public async Task<bool> verzendAsync(bericht mailMessage, string aan, string cc, string bcc)
{
bool res = true;
var message = new Message
{
Subject = mailMessage.Onderwerp,
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = mailMessage.Body
},
From = setRecipient(User),
ToRecipients = setRecipients(aan),
CcRecipients = setRecipients(cc),
BccRecipients = setRecipients(bcc)
};
if (mailMessage.Bijlagen == null || mailMessage.Bijlagen.Count == 0)
{
await graphClient().Users[User.email]
.SendMail(message, true)
.Request()
.PostAsync();
}
else
{
// de mail wordt als draft bewaard om later de bijlagen aan toe te voegen
Message draft = await graphClient().Users[User.email]
.Messages
.Request()
.AddAsync(message);
if (await setAttachements(mailMessage.Bijlagen, draft))
{
// na het eventueel toevoegen van de bijlagen, wordt het bericht verzonden
await graphClient().Users[User.email].Messages[draft.Id]
.Send()
.Request()
.PostAsync();
}
}
return res;
}
An API that connects multiple Microsoft services, enabling data access and automation across platforms