惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
博客园 - 【当耐特】
V
Visual Studio Blog
GbyAI
GbyAI
V
V2EX
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
量子位
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件

Resend RSS Feed

6 Tips for Accessible Emails Welcoming Manoel do Amaral, our new Brand Designer Welcoming Michael Vaz, our new Customer Success Engineer Six Steps to Improve Your Sender Reputation Welcoming Tatira Andrade, our new Executive Assistant Welcoming Pedro Ivo Hudson, our new Design Engineer Welcoming Diel Duarte, our new Open source Engineer Welcoming Areia Spinner, our new Recruiter Resend Forward: A Conference about Craft React Email 6.0 Custom Tracking Domains AI Email Editor Introducing Automations Welcoming Ahmed Tolba, our new SRE Engineer Welcoming Aneil Singh, our new Founding Account Executive Welcoming Lucas Motta, our new Software Engineer Welcoming Trey Knowles, our new Founding Account Executive Welcoming Anxhela Carciu, our new SRE Engineer Introducing DMARC Analyzer Welcoming Evan Thibodeau, our new Customer Success Engineer Welcoming Derich Pacheco, our new Software Engineer Welcoming Alec Ventura, our new Data Engineer Welcoming Felipe Freitag, our new Software Engineer Welcoming Mateusz Wos, our new Software Engineer Incident report for February 15, 2026 Email automation for OpenClaw How to Create a DevTools Agent Skill Introducing Email Skills Why You Should Embrace the Promotions Tab Slater Smith, our new Customer Success Engineer
How to send emails using Bun
Vitor Capretz · 2023-09-20 · via Resend RSS Feed

What is Bun again?

Bun is an all-in-one runtime for JavaScript. It comes with a bundler, test runner, and package manager.

The best thing about Bun is its speed. It's way faster than Node.js and Deno, which makes it pretty compelling for edge computing.

Since lots of emails are sent via background jobs running in edge functions, we decided to explore how to send emails using Bun.

Starting the HTTP server

To get started, we will create an index.tsx file and include a simple HTTP server that returns a "Hello World" message.

Run the local server by executing bun index.tsx on the terminal. Once you navigate to http://localhost:3000, you will see the message.

Now that we have this foundation, we can add the actual email functionality.

Adding Resend for email sending

First, we import the resend package and create a new client that will authenticate using an Resend API key.

Then, we call the send method and return the response object. In this example, we're sending an email using the html property.

Integrating React Email templates

Being able to send an email using HTML is nice, but being able to use an engine like React Email is even better.

To make things interesting, let's create a new waitlist-email.tsx file that will render a beautiful waitlist email.

Now that we have this template, we can import it into our index.tsx file and use it to send an email.

By running bun index.tsx, you should see the email being sent using React.

Learn more

We're excited to see what you build with Bun and Resend.

If you want to see the full code, you can check out the GitHub repository.