# Email Sender: Bulk Marketing Email From Your Own Domain (`lead_king/email-sender`) Actor

Send newsletters and marketing email to your opt-in list from your own domain. $1 per domain per month plus $0.50 per 1,000 emails. Personalize with {{merge fields}}. Includes DKIM/SPF/DMARC setup, one-click unsubscribe and bounce protection. No monthly plan, no contact limits.

- **URL**: https://apify.com/lead_king/email-sender.md
- **Developed by:** [Lead King](https://apify.com/lead_king) (community)
- **Categories:** Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 email sents

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Email Sender: Bulk Marketing Email From Your Own Domain

Send newsletters, product updates and promotions to **your opt-in list** from
**your own domain**. You don't need a monthly plan, and there's no contact limit or
seat price.

- **$1 per domain per 30 days**
- **$0.50 per 1,000 emails sent** ($0.0005 each)
- You only pay for emails that were sent. Skipped, failed and deferred recipients are free.

> ⚠️ **A paid Apify plan is required.** On Apify's free plan the run stops right away and returns no data. Nothing is charged.

### ⚠️ Opt-in email only

This Actor is for people who **asked to hear from you**: newsletter
subscribers, customers and users who opted in. **Don't use it for cold outreach, purchased
or scraped lists.** Sending to people who didn't opt in drives bounces and
spam complaints. When those get too high, sending from your account is
**paused automatically** until your sending reputation recovers.

### How it works

1. **Add domain** (`addDomain`). Enter a domain you control, such as `example.com` or
   `news.example.com`. It costs $1 for 30 days. The run gives you a few DNS
   records to add: DKIM, a bounce (MAIL FROM) subdomain, and an optional
   DMARC record. They're shown in the **Output** tab and the log.
2. Add the records at your DNS provider (Cloudflare, GoDaddy, Namecheap...).
3. **Check domain verification** (`checkDomain`). Re-run it until the status is
   `verified`. Both the DKIM and the bounce records are required, and the run tells you
   which ones are still missing. DNS changes usually show up within minutes, but can take
   up to 48 hours.
4. **Send emails** (`sendEmails`). Send from any address on the verified domain.

The domain renews automatically: if its 30 days have run out, the next **Send
emails** run charges $1 for another 30 days before sending. If you don't
send, it doesn't renew.

### Sending input

```json
{
  "action": "sendEmails",
  "fromEmail": "news@example.com",
  "fromName": "Acme Newsletter",
  "replyTo": "hello@example.com",
  "subject": "Hi {{firstName}}, here's what's new in May",
  "html": "<p>Hi {{firstName}},</p><p>...</p><p>Acme Inc, 1 Main St, Springfield</p><p><a href=\"{{unsubscribe}}\">Unsubscribe</a></p>",
  "recipients": [
    {"email": "ann@example.com", "firstName": "Ann"},
    {"email": "bob@example.com", "firstName": "Bob"}
  ],
  "campaignName": "may-newsletter"
}
```

- **Recipients** can be plain email strings or objects. Every field in an object
  becomes a merge field (`{{firstName}}`, `{{company}}`, ...). A missing
  field merges as empty.
- You can also read recipients from an Apify **dataset** (`datasetId`). Set
  `emailField` if the address isn't stored in `email`.
- **Unsubscribe:** `{{unsubscribe}}` is the recipient's personal unsubscribe link.
  If you leave it out, a small unsubscribe link is added at the bottom. Every
  email also carries the one-click unsubscribe header that Gmail and Yahoo
  require. People who unsubscribe are skipped automatically on every later send
  from your account.
- **Bounces and complaints** are suppressed automatically. Hard-bouncing
  addresses aren't emailed again.
- Include your **postal address** in the email. CAN-SPAM requires it.

### No duplicates and safe re-runs

A recipient gets each **campaign** at most once. The campaign defaults to your
from address plus subject; you can also set `campaignName`. If a run stops early
(daily limit, max charge, or you abort it), run it again with the same input.
Everyone who already got the email is skipped and not charged.

### Limits

- **2,000 emails per domain per day** (UTC). Recipients over the limit are marked
  `deferred` and aren't charged. Re-run tomorrow to continue.
- 100,000 recipients per run. The HTML body is limited to 500,000 characters.
  Attachments aren't supported; link to files instead.
- The run stops when it reaches your **maximum cost per run**. Raise it for big
  lists: 10,000 emails = $5.

### Output

One dataset row per recipient:

| status | meaning | charged |
| --- | --- | --- |
| `sent` | accepted for delivery | yes |
| `skipped` | invalid address, duplicate, unsubscribed, or already got this campaign | no |
| `deferred` | daily limit, max charge reached, or sending paused | no |
| `failed` | the address was rejected | no |
| `unknown` | the run timed out mid-batch; re-run the same campaign to retry safely | only if sent |

The run's **OUTPUT** record has the totals. Domain actions return one row per domain
with its status, paid-until date and DNS records.

### 🔗 Related Actors

Not the right fit? These Actors from the same developer cover the rest of the workflow:

- **[LinkedIn Contact Enricher](https://apify.com/lead_king/linkedin-contact-enricher)**: use this instead if you only have LinkedIn profile URLs and need an email and phone for each.
- **[Contact Enrichment](https://apify.com/lead_king/contact-enrichment)**: use this instead if your list has names + companies, emails or phone numbers (not just LinkedIn URLs) and you want the missing phones and emails.
- **[Leads Finder](https://apify.com/lead_king/leads-finder)**: use this instead if you don't have a list yet and want new leads by location, seniority, department, industry or company size, with emails and US phones.
- **[B2B People Search](https://apify.com/lead_king/people-search)**: use this instead if you want to search by job-title keywords or a specific company domain and get work emails plus company firmographics.
- **[LinkedIn Automation](https://apify.com/lead_king/linkedin-automation)**: use this instead if you want to send connection requests, messages, profile views and likes from your own LinkedIn account.

### FAQ

**Can I send from several domains?** Yes. Each domain is $1 per 30 days.

**Can I send from `anything@mydomain.com`?** Yes, any address on a verified
domain works. No extra setup needed.

**Why was my sending paused?** Your bounce or complaint rate was too high, which
almost always means emailing people who didn't opt in, or an old list. Clean
your list and send only to opted-in subscribers.

**Open and click tracking?** Not yet.

# Actor input Schema

## `action` (type: `string`):

First run 'Add domain' and add the DNS records it gives you, then 'Check domain' until it's verified. After that, 'Send emails' from any address on that domain.

## `domain` (type: `string`):

Add / Check / Remove domain: the domain you send from, e.g. example.com or news.example.com. You must be able to edit its DNS.

## `fromEmail` (type: `string`):

Send emails: the sender address, on a verified domain (e.g. news@example.com).

## `fromName` (type: `string`):

The sender name people see, e.g. Acme Newsletter.

## `replyTo` (type: `string`):

Optional. Where replies go (any address). Defaults to the from email.

## `subject` (type: `string`):

Merge fields work here too, e.g. 'Hi {{firstName}}, our May update'.

## `html` (type: `string`):

HTML body. Use {{fieldName}} for any recipient field (e.g. {{firstName}}, {{company}}) and {{unsubscribe}} for the unsubscribe link. If you leave out {{unsubscribe}}, a small unsubscribe link is added at the bottom. Include your postal address (required by CAN-SPAM).

## `text` (type: `string`):

Optional. Generated from the HTML if left empty.

## `recipients` (type: `array`):

Email addresses, or objects with an email plus any merge fields: \[{"email": "ann@example.com", "firstName": "Ann"}]. Only people who opted in to hear from you.

## `datasetId` (type: `string`):

Optional. Read recipients from an Apify dataset (each item's fields become merge fields).

## `emailField` (type: `string`):

Which field holds the email address in your recipients or dataset. Default: email.

## `campaignName` (type: `string`):

Nobody gets the same campaign twice: re-running with the same name (e.g. to continue after the daily limit) skips people who already got it. Defaults to the from email + subject.

## Actor input object example

```json
{
  "action": "checkDomain",
  "domain": "example.com",
  "emailField": "email"
}
```

# Actor output Schema

## `results` (type: `string`):

Open the results dataset.

## `resultsConsole` (type: `string`):

Browse the results in the Apify Console.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "action": "checkDomain",
    "domain": "example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("lead_king/email-sender").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "action": "checkDomain",
    "domain": "example.com",
}

# Run the Actor and wait for it to finish
run = client.actor("lead_king/email-sender").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "action": "checkDomain",
  "domain": "example.com"
}' |
apify call lead_king/email-sender --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lead_king/email-sender"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ICbigsWcOE29faKHj/builds/2nF6qraSEVkxqVGh5/openapi.json
