Skip to content

Mailgrid is an ultra-lightweight, high-throughput email automation CLI written in Go. It reads recipients from a CSV or Google Sheet and delivers emails via SMTP (Zoho, Gmail, etc.) with concurrency, rate-limiting, and optional scheduling — all without bloated dependencies.

License

Notifications You must be signed in to change notification settings

bravo1goingdark/mailgrid

Repository files navigation

Mailgrid Logo

Go Report Card Docs Badge Installation Guide Contributing Guide

Mailgrid is a high-performance, ultra-lightweight CLI tool written in Go for sending bulk emails via SMTP from CSV or Google Sheets. Built for speed, reliability, and minimalism — no bloated web UIs, just powerful automation.

✨ Key Features

  • Bulk email sending from CSV files or Google Sheets
  • Dynamic templating with Go's text/template for personalized content
  • Real-time monitoring dashboard with live delivery tracking
  • Resumable delivery with offset tracking for interrupted campaigns
  • Advanced scheduling with cron support and auto-start scheduler
  • High performance with connection pooling, batching, and concurrent processing
  • Production ready with zero dependencies, cross-platform support

📦 Installation

Quick install:

# Linux & macOS curl -sSL https://raw.githubusercontent.com/bravo1goingdark/mailgrid/main/install.sh | bash # Windows (PowerShell) iwr -useb https://raw.githubusercontent.com/bravo1goingdark/mailgrid/main/install.ps1 | iex 

Download binaries: GitHub ReleasesInstallation Guide

Setup:

  1. Create config.json:

    { "smtp": { "host": "smtp.gmail.com", "port": 587, "username": "your-email@gmail.com", "password": "your-app-password", "from": "your-email@gmail.com" } }
  2. Test installation:

    mailgrid --env config.json --to test@example.com --subject "Test" --text "Hello!" --dry-run

🚦 Quick Start

Single email:

mailgrid --env config.json --to user@example.com --subject "Hello" --text "Welcome!"

Bulk emails from CSV:

mailgrid --env config.json --csv recipients.csv --template email.html --subject "Hi {{.name}}!"

With monitoring:

mailgrid --env config.json --csv recipients.csv --template email.html --monitor --concurrency 5

Preview before sending:

mailgrid --env config.json --csv recipients.csv --template email.html --preview

Resumable delivery:

# Start campaign (automatically tracked) mailgrid --env config.json --csv recipients.csv --template email.html # Resume if interrupted mailgrid --env config.json --csv recipients.csv --template email.html --resume # Start fresh mailgrid --env config.json --csv recipients.csv --template email.html --reset-offset

📅 Scheduling & Automation

Schedule emails for later:

# One-time scheduling mailgrid --env config.json --to user@example.com --subject "Reminder" --text "Meeting at 3pm" --schedule-at "2025-01-01T10:00:00Z" # Recurring (every 30 minutes) mailgrid --env config.json --csv subscribers.csv --template newsletter.html --interval "30m" # Cron-based (daily at 9 AM) mailgrid --env config.json --csv recipients.csv --template report.html --cron "0 9 * * *"

Manage scheduled jobs:

mailgrid --jobs-list # List all jobs mailgrid --jobs-cancel "job-id-123" # Cancel specific job mailgrid --scheduler-run # Run as daemon

🔧 Common Flags

Short Long Flag Description
-e --env Path to SMTP config JSON
-f --csv Path to recipient CSV file
-u --sheet-url Public Google Sheet URL
-t --template Path to email HTML template
-s --subject Email subject line
-d --dry-run Render emails without sending
-p --preview Start preview server
-c --concurrency Number of concurrent workers
-m --monitor Enable monitoring dashboard
-a --attach File attachments
-w --webhook HTTP URL for notifications

📚 Documentation


📄 Licensed under BSD-3-Clause — see LICENSE

About

Mailgrid is an ultra-lightweight, high-throughput email automation CLI written in Go. It reads recipients from a CSV or Google Sheet and delivers emails via SMTP (Zoho, Gmail, etc.) with concurrency, rate-limiting, and optional scheduling — all without bloated dependencies.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •