Yes. This is explained in the documentation as well as in the FAQ .
From the FAQ:
How to create a message with attachments?
To create a message with attachments, the first thing you need to do is create a multipart/mixed Container to which you want to add a message body. After you have added the body, you can then add the MIME parts to it that contain the contents of the files you want to attach, be sure to set the value of the Content-Disposition header for the attachment. You might also want to set the filename parameter in the Content-Disposition header, as well as the name parameter in the Content-Type header. The most convenient way to do this is simply to use the MimePart.FileName property , which will set both parameters for you, and also set the value of the Content-Disposition header to attachment if it has not already been set to something else.
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?";
An easier way to create messages with attachments is to use the BodyBuilder class.
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 ();
For more information, see Creating Messages .
jstedfast
source share