A bulk email dispatcher written in Go using SMTP, CSV, and templating with concurrency.
- Load recipients from CSV
- Personalized email templates
- Email body from
.txtfile - CLI-based subject input
- SMTP-based sending (Gmail supported)
- Worker pool concurrency
- Env-based SMTP config
- Go 1.25+
- Gmail App Password (if using Gmail)
.envconfiguration file
Clone repository and create .env file and add .csv file in the same directory/folder
-
Example .env file
SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_EMAIL=your@gmail.com SMTP_PASS=your_app_password SMTP_FROM_NAME="Your Name"
-
Example .csv file
Name,Email user1,user1@gmail.com user2,user2@gmail.com
Create a email.templ file:
To: {{.Email}}
Subject: {{.Subject}}
Hi {{.Name}},
{{.Body}}
Thanks,
{{.FromName}}Create a body.txt file and add your email content in it
-
Cloned the repository for first time you have to run a command to install dependencies:
go mod tidy
-
Run Command:
go run . --subject "Your email subject" --body-file "Path to your body.txt file"
- Free Gmail Accounts: ~500 emails/day
- Workspace Accounts: ~2000 emails/day
├── main.go
├── producer.go
├── consumer.go
├── emails.csv
├── email.tmpl
├── body.txt
├── .env
└── README.md- Gmail requires App Passwords when 2FA is enabled.
- Concurrency can be configured in
main.gousingworkerCount.
This project is licensed under the MIT License. See the LICENSE file for details.