> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailbreeze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Send your first email with MailBreeze in 5 minutes

## Get Your API Key

1. Sign up at [console.mailbreeze.com](https://console.mailbreeze.com)
2. Navigate to **Settings > API Keys**
3. Click **Create API Key**
4. Copy your new key (starts with `sk_live_` or `sk_test_`)

<Warning>
  Keep your API key secret. Never commit it to version control or expose it in client-side code.
</Warning>

## Install an SDK

Choose your preferred language:

<CodeGroup>
  ```bash npm theme={null}
  npm install mailbreeze
  ```

  ```bash pip theme={null}
  pip install mailbreeze
  ```

  ```bash go theme={null}
  go get github.com/MailBreeze/mailbreeze-go
  ```

  ```bash composer theme={null}
  composer require mailbreeze/mailbreeze-php
  ```

  ```bash cargo theme={null}
  cargo add mailbreeze
  ```
</CodeGroup>

## Send Your First Email

<CodeGroup>
  ```typescript JavaScript theme={null}
  import { MailBreeze } from "mailbreeze";

  const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });

  const result = await mailbreeze.emails.send({
    from: "hello@yourdomain.com",
    to: "user@example.com",
    subject: "Hello from MailBreeze!",
    html: "<p>This is my first email sent via MailBreeze.</p>",
    text: "This is my first email sent via MailBreeze.",
  });

  console.log("Email sent:", result.id);
  ```

  ```python Python theme={null}
  import asyncio
  from mailbreeze import MailBreeze

  async def main():
      client = MailBreeze(api_key="sk_live_xxx")

      result = await client.emails.send(
          from_="hello@yourdomain.com",
          to="user@example.com",
          subject="Hello from MailBreeze!",
          html="<p>This is my first email sent via MailBreeze.</p>",
          text="This is my first email sent via MailBreeze.",
      )

      print(f"Email sent: {result.id}")

  asyncio.run(main())
  ```

  ```go Go theme={null}
  package main

  import (
      "context"
      "fmt"
      "log"

      mailbreeze "github.com/MailBreeze/mailbreeze-go"
  )

  func main() {
      client := mailbreeze.NewClient("sk_live_xxx")

      email, err := client.Emails.Send(context.Background(), &mailbreeze.SendEmailParams{
          From:    "hello@yourdomain.com",
          To:      []string{"user@example.com"},
          Subject: "Hello from MailBreeze!",
          HTML:    "<p>This is my first email sent via MailBreeze.</p>",
          Text:    "This is my first email sent via MailBreeze.",
      })
      if err != nil {
          log.Fatal(err)
      }

      fmt.Printf("Email sent: %s\n", email.ID)
  }
  ```

  ```php PHP theme={null}
  <?php
  require_once 'vendor/autoload.php';

  use MailBreeze\MailBreeze;

  $mailbreeze = new MailBreeze('sk_live_xxx');

  $result = $mailbreeze->emails()->send([
      'from' => 'hello@yourdomain.com',
      'to' => 'user@example.com',
      'subject' => 'Hello from MailBreeze!',
      'html' => '<p>This is my first email sent via MailBreeze.</p>',
      'text' => 'This is my first email sent via MailBreeze.',
  ]);

  echo "Email sent: " . $result['id'];
  ```

  ```rust Rust theme={null}
  use mailbreeze::{Client, SendEmailParams};

  #[tokio::main]
  async fn main() -> Result<(), mailbreeze::Error> {
      let client = Client::new("sk_live_xxx");

      let email = client.emails().send(SendEmailParams {
          from: "hello@yourdomain.com".to_string(),
          to: vec!["user@example.com".to_string()],
          subject: Some("Hello from MailBreeze!".to_string()),
          html: Some("<p>This is my first email sent via MailBreeze.</p>".to_string()),
          text: Some("This is my first email sent via MailBreeze.".to_string()),
          ..Default::default()
      }).await?;

      println!("Email sent: {}", email.id);
      Ok(())
  }
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.mailbreeze.com/v1/emails \
    -H "x-api-key: sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "from": "hello@yourdomain.com",
      "to": "user@example.com",
      "subject": "Hello from MailBreeze!",
      "html": "<p>This is my first email sent via MailBreeze.</p>",
      "text": "This is my first email sent via MailBreeze."
    }'
  ```
</CodeGroup>

## Test Mode

Use a test API key (starts with `sk_test_`) to simulate sending without delivering real emails:

```typescript theme={null}
const mailbreeze = new MailBreeze({ apiKey: "sk_test_xxx" });

// Emails are simulated, not delivered
const result = await mailbreeze.emails.send({ ... });
console.log(result.sandbox); // true
```

## Verify Your Domain

Before sending from your domain in production, you'll need to verify it:

1. Add your domain in the MailBreeze dashboard
2. Add the DNS records (SPF, DKIM, DMARC)
3. Click **Verify** to confirm

<Note>
  Domain verification ensures deliverability and prevents spoofing. Emails from unverified domains will be rejected.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Send with Templates" icon="palette" href="/api-reference/emails/send">
    Use pre-built templates with variable substitution
  </Card>

  <Card title="Add Attachments" icon="paperclip" href="/api-reference/attachments/create-upload">
    Upload and attach files to emails
  </Card>

  <Card title="Manage Contacts" icon="users" href="/api-reference/contacts/create">
    Create and organize your audience
  </Card>

  <Card title="Verify Emails" icon="shield-check" href="/api-reference/verification/verify">
    Validate addresses before sending
  </Card>
</CardGroup>
