# Deno 2.0 Transactional Email Guide: Native TypeScript Runtime

_By Tayyab Mughal, Founder & AI Chief · 6 August 2026 · 1 min read_

> How to build transactional email services using Deno 2.0, native TypeScript support, Deno.serve HTTP server, and web-standard fetch.

Deno 2.0 simplifies backend development with native TypeScript support and zero package.json bloat. Learn how to send transactional emails cleanly.

## Native TypeScript without compilation config

Deno 2.0 runs TypeScript files out of the box with zero build step, zero Babel/Webpack configuration, and built-in security permissions.

## Complete Deno 2.0 Email Server (server.ts)

Using the web-standard Deno.serve API, spin up an instant transactional email dispatch worker.

```typescript
Deno.serve(async (req: Request) => {
  if (req.method !== 'POST') {
    return new Response('Method Not Allowed', { status: 405 });
  }

  const { to, subject, message } = await req.json();
  const apiKey = Deno.env.get('SADASEND_API_KEY');

  const res = await fetch('https://api.sadasend.com/v1/emails', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ to, subject, text: message }),
  });

  const data = await res.json();
  return Response.json(data, { status: res.status });
});
```

## Running with explicit network permissions

Deno requires explicit permission flags: deno run --allow-net=api.sadasend.com,0.0.0.0 --allow-env server.ts

---

_Tags: Deno, TypeScript, DevTools, Runtime_
