Send emails from the terminal using pop

Send emails from the terminal using pop

posted 1 min read

Multi-Account Email Sender (pop wrapper)

This script wraps Charm's pop to send emails from multiple accounts directly from your terminal without config edits. Select your email, then use pop's interactive UI or CLI flags.

Features

  • Switch between multiple SMTP accounts via gum (or fallback menu)
  • Secure secrets from ~/.zsh_secrets
  • Exports POP_SMTP_USERNAME, POP_SMTP_PASSWORD, POP_FROM automatically
  • Passes all pop args through
  • Shellcheck clean, bash-compatible

Environment Variables

In ~/.zshrc (non-sensitive):

export POP_SMTP_HOST="smtp.gmail.com" # or smtp.outlook.com, etc.
export POP_SMTP_PORT=587

In ~/.zsh_secrets (chmod 600, gitignore!):

export POP_SMTP_USERNAME1="*Emails are not allowed*"
export POP_SMTP_PASSWORD1="abcd efgh ijkl mnop" # Gmail/Outlook APP PASSWORD
export POP_SMTP_USERNAME2="*Emails are not allowed*"
export POP_SMTP_PASSWORD2="ijkl mnop qrst uvwx" # APP PASSWORD (16 chars, no spaces)

⚠️ POP_SMTP_PASSWORDs are app-specific passwords (not your regular login)—generate from Gmail/Outlook 2FA security settings.

Dependencies

  • pop (Charm)
  • gum (optional, menu fallback built-in)

Usage

chmod +x ~/.local/bin/send_email
send_email # Interactive pop
send_email --to *Emails are not allowed* --subject "Hi" --body "Test"

Here is the link to the gist https://gist.github.com/Vaishnav-Sabari-Girish/51cbfc493fee25c209c39f0e74a17103

Save your dotfiles workflow!

1 Comment

1 vote
1

More Posts

Merry Christmas… in Your Linux Terminal

Igor Giamoniano - Coisa de Dev - Dec 25, 2025

Advent of Code Interactive

Vaishnav-sabari-girish - Dec 1, 2025

Note Taking app script

Vaishnav-sabari-girish - Dec 8, 2025

Writing Bootable USB Drives with dd: Precision Over Convenience

Igor Giamoniano - Coisa de Dev - Feb 1

I built a tiny Linux tool that shouts “FAHH” when I type the wrong command

AHamza89466 - Mar 16
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!