Exemple #1
0
        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;
        }
Exemple #2
0
 public void AddAttachment(Attachment objAttachment) {
     Message.Attachments.Add(objAttachment);
 }
Exemple #3
0
 public void AddAttachment(string file, string mimeType) {
     Attachment attachment = new Attachment(file, mimeType);
     Message.Attachments.Add(attachment);
 }