I add an attachment like this:
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(AttachmentPath); msg.Attachments.Add(attachment);
You need to load the attachment from a stream and then you can give it a name and a media type.
var fs = new FileStream("attachmentPath", FileMode.Open); var attachment = new System.Net.Mail.Attachment(fs, "MyAttachmentName.txt", "text/text");