I found that this feature does not work. It adds the attachment as inline only and all mail servers reject this.
var ms = new MemoryStream(<byte[]>);
var attachment = new MimeAttachment(ms, <file name="">, new ContentType("application/pdf"), AttachmentLocation.Attachmed);
mymessage.Attachments.Add(attachment);</file></byte[]>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
how can I add attachment as Stream?
I found that this feature does not work. It adds the attachment as inline only and all mail servers reject this.
var ms = new MemoryStream(<byte[]>);
var attachment = new MimeAttachment(ms, <file name="">, new ContentType("application/pdf"), AttachmentLocation.Attachmed);
mymessage.Attachments.Add(attachment);</file></byte[]>