| BodyBuilderLinkedResources Property |
Get the linked resources.
Namespace: MimeKitAssembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax public AttachmentCollection LinkedResources { get; }
Property Value
AttachmentCollectionThe linked resources.
Remarks
Linked resources are a special type of attachment which are linked to from the
HtmlBody.
Example var message = new MimeMessage ();
message.From.Add (new MailboxAddress ("Joey", "joey@friends.com"));
message.To.Add (new MailboxAddress ("Alice", "alice@wonderland.com"));
message.Subject = "How you doin?";
var builder = new BodyBuilder ();
builder.TextBody = @"Hey Alice,
What are you up to this weekend? Monica is throwing one of her parties on
Saturday and I was hoping you could make it.
Will you be my +1?
-- Joey
";
var image = builder.LinkedResources.Add (@"C:\Users\Joey\Documents\Selfies\selfie.jpg");
image.ContentId = MimeUtils.GenerateMessageId ();
builder.HtmlBody = string.Format (@"<p>Hey Alice,<br>
<p>What are you up to this weekend? Monica is throwing one of her parties on
Saturday and I was hoping you could make it.<br>
<p>Will you be my +1?<br>
<p>-- Joey<br>
<center><img src=""cid:{0}""></center>", image.ContentId);
builder.Attachments.Add (@"C:\Users\Joey\Documents\party.ics");
message.Body = builder.ToMessageBody ();
See Also