Email - SMTP Email with Zipped Log Attachments

Send SMTP emails with zipped log attachments and cleanup.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/lawless-m/Gwen --skill email-smtp-email-with-zipped-log-attachments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Email - SMTP Email with Zipped Log Attachments
Source: https://github.com/lawless-m/Gwen/tree/main/.claude/skills/Email
Command: npx skills add https://github.com/lawless-m/Gwen --skill email-smtp-email-with-zipped-log-attachments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Sending large log files via email attachments leads to size and locking issues. This skill provides patterns for SMTP email sending with automatic log compression to ZIP files, support for multiple attachments, and reliable cleanup.

Core Features & Use Cases

  • Read-locked logs: Reads logs using FileShare.ReadWrite to avoid lock errors
  • Zipped attachments: Compresses logs into temporary ZIP files to reduce size
  • Multiple attachments: Attaches zipped logs and additional files
  • Cleanup guarantees: Deletes temporary ZIPs in finally blocks
  • Graceful fallback: Falls back to non-zip attachments if zipping fails

Quick Start

Example: Create an Email instance and call:

  • email.SendWithZippedAttachment(null, "C:\Logs\report.log")

Frequently Asked Questions about Email - SMTP Email with Zipped Log Attachments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send large log files via email without hitting size limits?

Compress log files into ZIP attachments to reduce size before sending via SMTP. This skill automates the process by reading locked log files, zipping them into temporary files, attaching them to emails, and cleaning up afterward—solving both size and file-locking issues.

Can I attach multiple files to SMTP emails, including zipped logs?

Yes. This skill supports attaching both compressed ZIP files and additional files in a single SMTP email. You can send zipped logs alongside other attachments in one message.

How do I read log files that are locked by other processes?

Use FileShare.ReadWrite to open locked log files without waiting for exclusive access. This skill applies that pattern automatically, allowing you to read and compress logs even while they're actively being written.

What happens if zipping fails or SMTP delivery fails?

The skill includes graceful fallback behavior: if zipping fails, it falls back to attaching files uncompressed. Cleanup of temporary files is guaranteed in finally blocks regardless of success or failure.

Do I need to manually clean up temporary ZIP files after sending emails?

No. The skill automatically deletes temporary ZIP files in finally blocks after sending, ensuring no orphaned files accumulate on disk.

What's the best way to automate log collection and email reporting?

Combine automated log compression with SMTP delivery to create scheduled email reports. This skill handles the compression and attachment workflow, letting you focus on scheduling and report logic.