Skip to content

feat: Allow plaintext e-mails for SMTP#125

Merged
Amolith merged 2 commits into
charmbracelet:mainfrom
jficz:fix_115
Jul 13, 2026
Merged

feat: Allow plaintext e-mails for SMTP#125
Amolith merged 2 commits into
charmbracelet:mainfrom
jficz:fix_115

Conversation

@jficz

@jficz jficz commented Mar 1, 2025

Copy link
Copy Markdown
Contributor

Adds --plaintext flag which allows sending e-mails in plaintext with SMTP and Resend methods.

Fixes #115

@jficz

jficz commented Apr 13, 2025

Copy link
Copy Markdown
Contributor Author

@aymanbagabas @andreynering @raphamorim
politely requesting a review :) Sorry for the ping, not sure what's your review process

@aymanbagabas

Copy link
Copy Markdown
Contributor

Hi @jficz, this looks good!

Could you add POP_SMTP_PLAINTEXT=bool so that this option can be controlled by environment variables?

@raphamorim raphamorim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt

@jficz

jficz commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

Could you add POP_SMTP_PLAINTEXT=bool

sure, gimme a day or two

@jficz

jficz commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

@aymanbagabas added as POP_PLAINTEXTas, strictly speaking, it doesn't have anything to do with SMTP (as in the protocol)

@jficz

jficz commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

also, any chance of a release with this feat ?

@aymanbagabas

Copy link
Copy Markdown
Contributor

@aymanbagabas added as POP_PLAINTEXTas, strictly speaking, it doesn't have anything to do with SMTP (as in the protocol)

Perfect!

Could you add Resend support as well? With Resend, we can omit the HTML version of the message when using plaintext

@jficz

jficz commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

The reason I did not implement this for Resend is that, tbh, I did not really understand the code. I can take look but that will take more time.

@jficz

jficz commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

@aymanbagabas tried in e1e08d4 but I have absolutely no idea if this will work 🤷‍♂️

I don't really understand the unsafe condition or how resend.SendEmailRequest works. Assuming it just ignores Html if the string is empty.

@Amolith

Amolith commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@jficz I'd like to get this in; if you're still interested in working on it, would you mind rebasing on main? Sending empty HTML through Resend in the plaintext case worked fine for me, so I think rebasing and fixing the conflicts is all that's left.

No pressure either way, I'm happy to handle it if you'd rather not!

@jficz

jficz commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

sure, let me see what I can do

Adds `--plaintext` flag which allows sending
e-mails in plaintext with SMTP method.

Also adds counterpart POP_PLAINTEXT.

Not implemented for the Resend method.
@jficz

jficz commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@Amolith ✔️

@Amolith Amolith merged commit 6193324 into charmbracelet:main Jul 13, 2026
6 of 7 checks passed
@Amolith

Amolith commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@jficz thank you! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add a "send in plain text" option

4 participants