private void AddArchiveEntry(ZipArchive archive, Attachment attachment) { var entry = archive.CreateEntry(attachment.Path, CompressionLevel.Fastest); using (var writerStream = entry.Open()) using (var binaryWriter = new BinaryWriter(writerStream)) { binaryWriter.Write(attachment.Content); } entry.LastWriteTime = attachment.LastWriteTime; }
public void AddAttachment(Attachment objAttachment) { Message.Attachments.Add(objAttachment); }
public void AddAttachment(string file, string mimeType) { Attachment attachment = new Attachment(file, mimeType); Message.Attachments.Add(attachment); }