Published on

How to send email from your Terminal using Pop CLI

Authors

There are times when you might want to send an email from your terminal.

It could be a status/warning notification or alert. Or it could be just for fun.

Here's how to do it easily using Pop CLI

Depedency

Pop CLI uses Resend under the hood and makes sure to get RESEND_API_KEY from the dashboard.

As for installing the Pop CLI, we can do it easily with brew.sh

brew install pop
# Configure API key as env prop
export RESEND_API_KEY="re_YOUR_KEY_HERE"

Send email via interactive CLI

Just run pop

Instead of entering the data every single time when sending an email. You can also pass the needed information as a parameter

pop < message.md \
    --from "me@example.com" \
    --to "you@example.com" \
    --subject "Hello, world!"

You can read their official documentation to learn more about how to use the CLI efficiently.

Happy sending emails!