Using Abp IEmailSender, I try to send an email with an attachment. I want this attachment displayed inline.
Previously we were using SendAsync with a MailMessage, the Inline property were set on the Attachment object and it worked fine :
MailMessage mailMessage = new(fromMail, command.Email)
{
Subject = subject,
Body = body,
IsBodyHtml = true
};
Attachment attachment = new(fileContent, fileName, mimeType)
{
ContentId = contentId
};
attachment.ContentDisposition!.Inline = true;
mailMessage.Attachments.Add(attachment);
await EmailSender.SendAsync(mailMessage);
To send emails in a background thread we now use QueueAsync.
EmailAttachment attachment = new ()
{
File = await fileInfo.ReadBytesAsync(),
Name = fileName,
};
AdditionalEmailSendingArgs args = new()
{
Attachments = [attachment]
};
await EmailSender.QueueAsync(fromMail, command.Email, subject, body, true, args);```
Is there a way to make the attachment inline in this case ?