forked from lukencode/FluentEmail
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I have encountered an issue when using the AzureEmailSender and GraphSender classes to send emails with inline attachments.
Unfortunately, it appears that this method is ineffective.
Could you please add a mapping for the Content-Id to resolve this issue?
// GraphSender.cs
if (email.Data.Attachments != null && email.Data.Attachments.Count > 0)
{
message.Attachments = new MessageAttachmentsCollectionPage();
email.Data.Attachments.ForEach(a =>
{
var attachment = new FileAttachment
{
Name = a.Filename,
ContentType = a.ContentType,
ContentBytes = GetAttachmentBytes(a.Data),
IsInline = a.IsInline,
ContentId = a.ContentId
};
message.Attachments.Add(attachment);
});
}//AzureEmailSender.cs
private async Task<EmailAttachment> ConvertAttachment(FluentEmail.Core.Models.Attachment attachment) =>
new(attachment.Filename, attachment.ContentType, await BinaryData.FromStreamAsync(attachment.Data)) { ContentId = attachment.ContentId };Metadata
Metadata
Assignees
Labels
No labels