# Email Quickstart

Deploy production-ready email infrastructure to your AWS account in under 2 minutes.

## What You'll Build

- AWS SES with DKIM, SPF, and DMARC configured automatically
- A verified sending domain in your AWS account
- Your first email sent via the TypeScript SDK

Time: ~2 minutes

## Prerequisites

- Node.js 20 or later
- An AWS account with valid credentials configured
- AWS CLI installed and configured (or AWS credentials in environment variables)

## Step 1: Deploy Infrastructure

```bash
npx @wraps.dev/cli email init
```

This deploys SES, DynamoDB, Lambda, EventBridge, and IAM roles to your AWS account. Takes 1-2 minutes. You'll be prompted to choose a preset (Starter, Production, or Enterprise) and shown estimated monthly AWS costs.

## Step 2: Install the SDK

```bash
npm install @wraps.dev/email
# or: pnpm add @wraps.dev/email | yarn add @wraps.dev/email | bun add @wraps.dev/email
```

## Step 3: Send Your First Email

```typescript
import { WrapsEmail } from '@wraps.dev/email';

const email = new WrapsEmail();

const result = await email.send({
  from: 'hello@yourdomain.com',
  to: 'user@example.com',
  subject: 'Welcome to Wraps!',
  html: '<h1>Hello from Wraps!</h1><p>This email was sent using AWS SES.</p>',
});

if (result.success) {
  console.log('Email sent:', result.data.messageId);
} else {
  console.error('Failed to send email:', result.error);
}
```

> **Domain Verification**: Before sending, verify your domain with AWS SES:
> `npx @wraps.dev/cli email domains verify -d yourdomain.com`

## Step 4: View Analytics (Optional)

```bash
npx @wraps.dev/cli dashboard
```

Opens at localhost:5555 — view email history, delivery rates, bounces, and complaints.

## Next Steps

- [Email SDK Reference](https://wraps.dev/docs/sdk-reference) — all methods and options
- [CLI Reference](https://wraps.dev/docs/cli-reference) — manage infrastructure
- [Domain Verification Guide](https://wraps.dev/docs/guides/domain-verification)
- [Next.js Guide](https://wraps.dev/docs/quickstart/email/nextjs)
- [Agent Guide](https://wraps.dev/docs/quickstart/email/agents)
