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

推荐订阅源

D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
IT之家
IT之家
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research

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.