News for hackers. Stuff that matters.

Show HN: Send Emails from Your Terminal

https://github.com/charmbracelet/pop

One of my favorite developer tool companies in the world is Charm. So I was blown away when they said they were rethinking how email could be sent using the terminal.

Pop is a Text-based User Interface (TUI) that allows you to send emails without having to switch context from your command-line interface.

Here's why I'm obsessed with Pop:

1. You can write an email body with AI

2. You can easily install using Homebrew

3. You can do some really powerful stuff like generating a PDF and sending an invoice via email entirely from the command line

The email sending part is taken care by Resend, another developer-first product, which makes it the perfect integration for this.

As a developer, I live in the terminal. And I would love to hear how other developers feel about this. We would love to hear your ideas, experiences, and feedback.

( 28 comments | 24 points | on HN )
Re:Show HN: Send Emails from Your Terminal by jitl on Monday July 17, 2023 @10:29AM (#36758657)
You can also send email from your terminal using a traditional mail agent like mutt, which also installs via homebrew, but doesn’t require a proprietary API key to send email. Mutt will happily send email as your Gmail user. Mutt can also read email, so if you really live in the terminal it can do it all.

https://www.makeuseof.com/install-configure-mutt-with-gmail-...

Re:Show HN: Send Emails from Your Terminal by nimbius on Monday July 17, 2023 @10:36AM (#36758761)
neomutt even has a litany of cool new features like TLS SNI, threading and encrypt-to-self.

https://github.com/neomutt/neomutt

Re:Show HN: Send Emails from Your Terminal by hirow on Monday July 17, 2023 @10:37AM (#36758767)
> The email sending part is taken care by Resend, another developer-first product, which makes it the perfect integration for this.

Please add a disclaimer that you're one of the founders of Resend. I had no idea before clicking on your profile.

Re:Show HN: Send Emails from Your Terminal by brazzledazzle on Monday July 17, 2023 @10:39AM (#36758796)
I suppose that’s the answer to a few of the questions in this thread.
Re:Show HN: Send Emails from Your Terminal by heinrichhartman on Monday July 17, 2023 @10:39AM (#36758798)
As other's have pointed out, sending emails from the command line is a solved problem [1]:

    sendmail [email protected] < email.txt

    mail -s "Test Subject" [email protected] < body.txt
What keeps me from actually using this, is the lack of Address Book, as I don't memorize email addresses from all my friends and colleagues. Any suggestions on how to integrate my Gmail Address book into a command line workflow?

[1] https://stackoverflow.com/questions/57410259/how-to-send-an-...

Re:Show HN: Send Emails from Your Terminal by maaslalani on Monday July 17, 2023 @10:41AM (#36758835)
You can use the `--to` flag and something like FZF or Gum to populate that from a text file.

`pop --to $(fzf contacts.txt)`

Re:Show HN: Send Emails from Your Terminal by pwg on Monday July 17, 2023 @10:50AM (#36758953)
Provided you are willing to build the alias [1] mapping list, mutt can use aliases on the CLI to send emails.

So if you had aliased "[email protected]" to "bob", you could do:

    mutt -s "Test Subject" bob < body.txt
I do not know of a way to automatically generate a mutt alias file from a gmail address book.

[1] Mutt refers to its address book as "aliases".

Re:Show HN: Send Emails from Your Terminal by flir on Monday July 17, 2023 @04:41PM (#36763751)
Almost sounds like you need a user completion script that queries your address book. (Implementation left as an exercise for the reader).
Re:Show HN: Send Emails from Your Terminal by olivierduval on Monday July 17, 2023 @10:34AM (#36758728)
What is the problem with the mail command ? Or with some msmtp ?

Except that with "standard" mail you only need a provider or self-hosted server, and not a RESEND_KEY

To me, it looks like "reinventing the wheel"... Did I miss something ?

BTW: content generation (AI, email) is not email sending, so you can still generate content with other tools and send it with a simple "mail" command

Re:Show HN: Send Emails from Your Terminal by mcmcmc on Monday July 17, 2023 @10:37AM (#36758781)
* * *
Re:Show HN: Send Emails from Your Terminal by klaas- on Monday July 17, 2023 @10:41AM (#36758825)
you can also send mails with curl via cli https://everything.curl.dev/usingcurl/smtp
Re:Show HN: Send Emails from Your Terminal by murat124 on Monday July 17, 2023 @10:36AM (#36758750)
telnet host port

ehlo mailback

mail from: [email protected]

rcpt to: [email protected]

data

mail from: "my name" <[email protected]>

rcpt to: "their name" <[email protected]>

subject: whatever

mail text goes here but don't forget an empty line between subject line and this line (as a separator of header and body)

and here

and end mail text by a single dot in a single line like this

.

quit

for attachments or other advanced features you can use mutt, pine, or any other mail app. you can also do:

cat mail-text.txt | mail -s "subject goes here" [email protected]

Re:Show HN: Send Emails from Your Terminal by brazzledazzle on Monday July 17, 2023 @10:38AM (#36758784)
Should be noted that telnet only works when you have unauthenticated access to your mail server.
Re:Show HN: Send Emails from Your Terminal by susam on Monday July 17, 2023 @10:42AM (#36758847)
I remember performing authentication via telnet session as well: https://susam.net/blog/auth-cram-md5.html (2011)

Of course, these days, the connection should be wrapped within a TLS session and openssl s_client could be a good alternative to telnet for doing that.

Re:Show HN: Send Emails from Your Terminal by neverrroot on Monday July 17, 2023 @10:39AM (#36758809)
If the purpose is learning, really cool, am sure you learned plenty. Otherwise, there are already so many CLI mail tools, would really appreciate, if you could tell us, why use this one instead of the established ones. Thanks!
Re:Show HN: Send Emails from Your Terminal by itslennysfault on Monday July 17, 2023 @10:47AM (#36758907)
Because resend, a YC company, wants you to use their API so they created this.
Re:Show HN: Send Emails from Your Terminal by eterps on Monday July 17, 2023 @10:32AM (#36758695)
The tool certainly presents an appealing design, however I am unsure of the necessity of its interactive features.

It mixes several concerns that I would typically assign to separate applications, such as fzf and $EDITOR.

Re:Show HN: Send Emails from Your Terminal by brazzledazzle on Monday July 17, 2023 @10:36AM (#36758758)
Resend seems like it might be unnecessary and overkill. Why not just send mail through your mail provider directly? Or is this more about sending email campaigns from the CLI?
Re:Show HN: Send Emails from Your Terminal by pwg on Monday July 17, 2023 @10:58AM (#36759059)
Re:Show HN: Send Emails from Your Terminal by amingilani on Monday July 17, 2023 @10:32AM (#36758693)
What is resend and why do I need it to work with this?
Re:Show HN: Send Emails from Your Terminal by ottavio on Monday July 17, 2023 @10:29AM (#36758665)
what's wrong with mutt? ;-)
Re:Show HN: Send Emails from Your Terminal by xnx on Monday July 17, 2023 @10:46AM (#36758888)
Is at inevitable characteristic of people interested in software to ignore reliable/existing/"boring" tools and reinvent the wheel? I can see the benefit as a learning experience, but a lot of these diy efforts accidentally become popular to the detriment of better tools.
Re:Show HN: Send Emails from Your Terminal by chaxor on Monday July 17, 2023 @10:46AM (#36758891)
I typically love things from charm bracelet. They make phenomenally good looking TUIs. For that alone I will try to work with this. However, I do agree that there is a tendency in many of the projects to lean on unnecessary servers by default. For example, to have a local glow experience, you have to edit the config to not send your data (encrypted of course, which is good) to a centralized server.

I'm going to contradict myself here, but soft-serve is also phenomenal, but only works with self hosted git, but not gitlab. This is great (as said before, cloud should not be default) but sometimes you want to connect to a well known standard git server like gitlab.

Anyway, this looks great, despite the existence of aerc, etc. I think it's a welcome addition, but if the additionally API key can be removed, and if it can work with complicated emails like Oath 2 and Microsoft office webmail, it will likely take off.

Re:Show HN: Send Emails from Your Terminal by danielvaughn on Monday July 17, 2023 @10:47AM (#36758912)
I'd love to see something like oh-my-zsh but for stuff like this, because there are a ton of day-to-day utilities I'd like to use in the terminal, but I don't have time to track them all down and configure them.

For instance, I'd love to see a good to-do list. I've tried a couple but they underwhelmed me.

Re:Show HN: Send Emails from Your Terminal by 38 on Monday July 17, 2023 @10:50AM (#36758966)
> To use pop, you will need a RESEND_API_KEY.

NOPE. no thank you. cURL can already do this:

https://stackoverflow.com/questions/14722556/using-curl-to-s...

Re:Show HN: Send Emails from Your Terminal by 40yearoldman on Monday July 17, 2023 @11:26AM (#36759402)
What old is new again…
Re:Show HN: Send Emails from Your Terminal by gushie on Monday July 17, 2023 @01:28PM (#36761202)
I remember using 'elm' for terminal based email back in the 1990s.
Re:Show HN: Send Emails from Your Terminal by 8__8 on Sunday July 23, 2023 @03:10AM (#36833194)
In the linux and mac console (via brew) there is also swaks - a simple tool for sending e-mails.

echo "mail body" | swaks -t mail@to -s server -tls -a LOGIN -au mail_login -ap password --from from@mail --h-Subject subject --body -

and mail is send ;-)