I am testing .Net Core MVC, which does not support System.Net.Mail, the only alternative I found is Mailkit, works well but can't figure out how to send attachments that I have stored in my database as binary. I used the following in MVC 5:
var mail = new MailMessage();
mail.Attachments.Add(new Attachment(new MemoryStream(attachment),
attachmentName, attachmentType));
How can I do it in MailKit.
You need to create a builder and then add the attachments to it, the attachments can be either IFromFile or in Binary string. Hope this helps.