# Explore sending features

> MailBlastr has a wide range of features for sending both transactional and marketing email.

MailBlastr provides a REST API, webhooks, audiences, campaigns, and a dashboard for both kinds of email you need to send:

- **Transactional email** — personalized, event-driven messages.
- **Marketing campaigns** — bulk [campaigns](https://www.mailblastr.com/docs/campaigns/managing) distributed to a contact list.

All of these features are also available through the dashboard, so your whole team can create and send email, manage contacts, and track performance — not just developers calling the API.

## I need to send transactional email

A **transactional email** is a message triggered by a user action or required for legal compliance. It is typically a **1-to-1** message sent in response to a specific event. Common examples include:

- Order confirmations
- Password reset emails
- Account notifications

Send transactional email from your application with a single `POST /emails` request from your verified domain:

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.emails.send({
  "from": "Acme <orders@yourdomain.com>",
  "to": ["customer@example.com"],
  "subject": "Your order is confirmed",
  "html": "<p>Thanks for your order!</p>"
});
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Emails.send({
  "from": "Acme <orders@yourdomain.com>",
  "to": [
    "customer@example.com"
  ],
  "subject": "Your order is confirmed",
  "html": "<p>Thanks for your order!</p>"
})
```

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

$mailblastr->emails->send([
  'from' => "Acme <orders@yourdomain.com>",
  'to' => [
    "customer@example.com"
  ],
  'subject' => "Your order is confirmed",
  'html' => "<p>Thanks for your order!</p>"
]);
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Emails.send({
  "from": "Acme <orders@yourdomain.com>",
  "to": [
    "customer@example.com"
  ],
  "subject": "Your order is confirmed",
  "html": "<p>Thanks for your order!</p>"
})
```

**Go**

```go
import "github.com/shekhu10/mailblastr-sdks/mailblastr-go"

client := mailblastr.NewClient("mb_xxxxxxxxx")

params := &mailblastr.SendEmailRequest{
    From:    "Acme <hello@yourdomain.com>",
    To:      []string{"delivered@example.com"},
    Subject: "hello world",
    Html:    "<p>it works!</p>",
}
sent, err := client.Emails.Send(params)
```

**Rust**

```rust
use mailblastr::{Mailblastr, CreateEmailBaseOptions};

let mb = Mailblastr::new("mb_xxxxxxxxx");

let email = CreateEmailBaseOptions::new(
    "Acme <hello@yourdomain.com>",
    ["delivered@example.com"],
    "hello world",
).with_html("<p>it works!</p>");
let _sent = mb.emails.send(email).await?;
```

**Java**

```java
import com.mailblastr.*;

Mailblastr mailblastr = new Mailblastr("mb_xxxxxxxxx");

SendEmailRequest request = SendEmailRequest.builder()
    .from("Acme <hello@yourdomain.com>")
    .to("delivered@example.com")
    .subject("hello world")
    .html("<p>it works!</p>")
    .build();
mailblastr.emails().send(request);
```

**.NET**

```csharp
using Mailblastr;

IMailblastr mailblastr = MailblastrClient.Create("mb_xxxxxxxxx");

var resp = await mailblastr.EmailSendAsync(new EmailMessage
{
    From = "Acme <hello@yourdomain.com>",
    To = "delivered@example.com",
    Subject = "hello world",
    HtmlBody = "<p>it works!</p>",
});
```

**cURL**

```bash
curl -X POST 'https://api.mailblastr.com/emails' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "Acme <orders@yourdomain.com>",
  "to": ["customer@example.com"],
  "subject": "Your order is confirmed",
  "html": "<p>Thanks for your order!</p>"
}'
```

**CLI**

```bash
mailblastr emails send \
  --from 'Acme <orders@yourdomain.com>' \
  --to 'customer@example.com' \
  --subject 'Your order is confirmed' \
  --html '<p>Thanks for your order!</p>'
```

You can also receive [webhooks](https://www.mailblastr.com/docs/webhooks/overview) for delivery and engagement events, [schedule](https://www.mailblastr.com/docs/emails/schedule) email for later, and add [attachments](https://www.mailblastr.com/docs/emails/attachments) or [custom headers](https://www.mailblastr.com/docs/emails/headers).

## I need to send bulk marketing email

Marketing emails are **promotional**, **informative**, or general-communication messages. They are typically **1-to-many**, sent when you want to reach a larger audience (for example, a newsletter). Examples include:

- Promotional offers and discounts
- Newsletters
- Product updates

> **Warning:** Marketing email is regulated by laws like **CAN-SPAM** (US) and **CASL** (Canada). Recipients must have a working option to unsubscribe — MailBlastr adds a per-contact unsubscribe to every campaign for you.

Send [campaigns](https://www.mailblastr.com/docs/campaigns/managing) to your subscribers from the dashboard or the Campaigns API. With campaigns you get tools for [managing your audiences and contacts](https://www.mailblastr.com/docs/audiences/overview), tracking performance, and per-contact unsubscribe handling. MailBlastr also handles queuing, throttling, and scheduling so you do not have to roll your own infrastructure.

## I need to send a combination of email

It is common to need both. Your customers need personalized messages about their orders, but may also subscribe to a newsletter sent to your entire contact list. Some email does not fit neatly into one category:

- Marketing email can be **1-to-1** when based on personalized activity (e.g. abandoned-cart reminders or drip campaigns). You can send these through the transactional `POST /emails` API, as long as proper consent and compliance rules are followed.
- The [batch send](https://www.mailblastr.com/docs/emails/batch) endpoint can send multiple transactional emails at once (up to 100), even to different recipients with unique content, instead of one request per email.

You can use MailBlastr’s opinionated, full-featured solutions or design your own architecture from the ground up — all of the API, webhooks, audiences, campaigns, and dashboard controls are available for any type of sending you build.

## Learn more

- [Send Email API](https://www.mailblastr.com/docs/api/emails-send) — send, list, retrieve, and cancel transactional email.
- [Campaigns](https://www.mailblastr.com/docs/campaigns/managing) — create and send marketing email to an audience.
- [Audiences & contacts](https://www.mailblastr.com/docs/audiences/overview) — build and manage contact lists.
- [Webhooks](https://www.mailblastr.com/docs/webhooks/overview) — receive delivery and engagement events.

## Next steps

- [Add a domain](https://www.mailblastr.com/docs/add-a-domain) and [create an API key](https://www.mailblastr.com/docs/create-an-api-key) if you have not yet.
- Send your first transactional email with the [Quickstart](https://www.mailblastr.com/docs/quickstart).
- Import or add contacts to an [audience](https://www.mailblastr.com/docs/audiences/overview) to prepare your first campaign.
