Dataset to Email — CSV, XLSX, JSON via your SMTP or API avatar

Dataset to Email — CSV, XLSX, JSON via your SMTP or API

Pricing

$5.00 / 1,000 email sents

Go to Apify Store
Dataset to Email — CSV, XLSX, JSON via your SMTP or API

Dataset to Email — CSV, XLSX, JSON via your SMTP or API

Emails any Apify dataset as CSV, XLSX or JSON attachments with an HTML preview table, through your own SMTP server (Gmail or any host) or Resend, SendGrid, Mailgun, Postmark or Brevo. Works as an integration. $0.005 per email sent; dry runs and failures are free.

Pricing

$5.00 / 1,000 email sents

Rating

0.0

(0)

Developer

도영 김

도영 김

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

10 days ago

Last modified

Features

Limited permissions

Share

What does Dataset to Email do?

It emails the results of an Actor run. The dataset is attached as CSV, XLSX or JSON (any combination), and the email body carries a short summary and an HTML preview table of the first rows.

The email is sent through your own SMTP server or email API account — Gmail, any SMTP host, Resend, SendGrid, Mailgun, Postmark or Brevo. It leaves from your address, with your domain's reputation, to any recipient your provider allows.

  • Works as an integration. Attach it to any Actor or task and every finished run is emailed. No base64, no code.
  • Attachments are built for you. CSV is UTF-8 with BOM and RFC 4180 quoting, so it opens correctly in Excel. XLSX keeps numbers as numbers. Nested data is flattened to a.b.c columns.
  • Safe to open. Values that look like formulas (=, +, -, @) cannot run: CSV cells get a leading ', XLSX cells are written as text.
  • Large results do not fail the run. Above the size limit the attachments are left out and download links to the dataset are put in the body instead.
  • Try before you send. dryRun renders the email into the key-value store without sending anything and without any credentials.
  • Honest results. Every run writes one row with a status, machine-readable reason codes and whether it was charged.

This Actor is for reports and alerts. It must not be used for bulk, promotional or unsolicited email: one run sends one email to at most 20 recipients (to + cc + bcc).

How much does it cost?

$0.005 per email sent (pay per event, event email-sent). Apify may add its own small Actor-start event; the run's cost breakdown shows it.

You are charged only when your provider accepts the email (status sent) — once per run, whatever the number of recipients, rows or attachments.

StatusCharged
sent$0.005
dry_runfree
skipped_emptyfree
failedfree

Your SMTP or email API provider may bill you separately under its own plan. If you set a maximum cost per run and it does not cover one email, nothing is sent (reason BUDGET_EXCEEDED).

Use it as an integration

  1. Open the Actor or task whose results you want by email.
  2. Go to Integrations, choose to connect another Actor, and pick Dataset to Email.
  3. Choose when it runs (for example Run succeeded).
  4. Fill in to, from and the provider settings. Turn dryRun off. Set datasetId to {{resource.defaultDatasetId}} (switch the input to JSON view if the dataset picker does not accept a variable). This Actor runs with limited permissions, and a dataset passed through the datasetId field is the only one it is allowed to read — without it the run fails with DATASET_READ_FAILED. Remove the example rows.

{{actorName}}, {{runId}} and {{runStatus}} are filled from the run that triggered the integration, so one setup can report failures too: trigger on Run failed and the default subject starts with [FAILED].

You can also run it directly with a datasetId, on a schedule, from the API, or from an AI agent with rows.

Provider setup

Pick a provider in Send with and fill only its fields.

ProviderproviderWhat to enterNotes
Gmail / Google WorkspacesmtpsmtpHost smtp.gmail.com, smtpPort 587, smtpUser your address, smtpPassword an app passwordNeeds 2-Step Verification; create the app password in your Google Account. Your normal password is rejected. from must be the account address or one of its aliases.
Any SMTP serversmtpsmtpHost, smtpPort (587, 465, 2525 or 25), smtpUser, smtpPassword465 uses implicit TLS; the other ports use STARTTLS, which is required.
ResendresendapiKeyfrom must be on a domain verified in Resend.
SendGridsendgridapiKey (Mail Send permission)from must be a verified sender or on an authenticated domain.
MailgunmailgunapiKey, mailgunDomain, mailgunRegion (us or eu)Use the region your domain was created in.
PostmarkpostmarkapiKey = the server tokenfrom must be a confirmed sender signature or domain.
BrevobrevoapiKeyfrom must be a validated sender.

Passwords and API keys are secret inputs: Apify stores them encrypted, and this Actor never writes them to the log, the output or error messages.

Input

FieldDefaultMeaning
torequiredRecipient addresses. At most 20 across to, cc, bcc. Name <a@b.com> is accepted.
fromrequiredA sender address you own. Name <a@b.com> is accepted.
cc, bcc, replyTononeOptional. Duplicates across to, cc, bcc are sent once.
dryRunfalseRender only: nothing is sent, no provider settings needed. See Dry run.
datasetIdnoneDataset to send. In an integration use {{resource.defaultDatasetId}}.
rowsnoneA JSON array of objects to send instead of a dataset.
fieldsallColumns to include, in this order. A parent name (details) includes every column under it.
omitFieldsnoneColumns to exclude.
maxRows10000Rows to read, 1 to 100,000. More rows are cut off and reported.
skipIfEmptyfalsefalse: 0 rows sends a "no results" email. true: nothing is sent, status skipped_empty.
subject, text, htmlgeneratedLeave all empty for the default subject and body. Give only text or only html to send only that part.
previewRows20Rows in the preview table, 0 to 100. 0 removes the table. The table shows at most 8 columns.
attachmentFormats["csv"]Any of csv, xlsx, json. [] sends no attachment.
maxAttachmentMb10Total attachment size limit, 1 to 20 MB. See Limits.
providersmtpsmtp, resend, sendgrid, mailgun, postmark or brevo.
smtpHost, smtpPort, smtpSecure, smtpUser, smtpPasswordport 587SMTP only.
apiKeynoneAPI providers only.
mailgunDomain, mailgunRegionregion usMailgun only.

The data source is the first of: datasetId, the integration payload, rows.

Placeholders

Usable in subject, text and html. In html the values are HTML-escaped.

PlaceholderValue
{{itemCount}}Number of rows sent
{{datasetId}}Dataset ID (empty with rows)
{{actorName}}Title of the Actor that produced the dataset (empty if unknown)
{{runId}}Run that produced the dataset
{{runStatus}}Status of the triggering run, for example SUCCEEDED (integration only)
{{date}}Date of this run, YYYY-MM-DD, UTC
{{datasetUrl}}API link to the dataset items (text and html only)
{{previewTable}}The preview table (text and html only)

Dry run

With dryRun: true nothing is sent and nothing is charged. The run saves:

  • EMAIL_PREVIEW — JSON with the subject, text body, HTML body, attachment names and sizes.
  • EMAIL_PREVIEW.html — the HTML body, which you can open in a browser.

The prefilled input is a dry run with two example rows, so the first run of this Actor succeeds without any setup.

Output

One dataset item per run, also stored as the OUTPUT record:

{
"status": "sent",
"provider": "smtp",
"messageId": "<b1f5c0c2-7d1e-4f1e-9c57-0a2a7a7e6f01@yourdomain.com>",
"recipientCount": 3,
"rejectedRecipientCount": 0,
"itemCount": 1250,
"source": "integration",
"datasetId": "aBcDeFgHiJkLmNoPq",
"attachments": [
{ "filename": "shop-scraper-2026-11-12.csv", "format": "csv", "bytes": 184220 },
{ "filename": "shop-scraper-2026-11-12.xlsx", "format": "xlsx", "bytes": 96412 }
],
"attachmentBytes": 280632,
"reasons": [],
"message": "Email accepted by smtp for 3 of 3 recipient(s), 1250 row(s), 2 attachment(s).",
"providerMessage": null,
"attempts": 1,
"previewKey": null,
"durationMs": 2140,
"charged": true
}

Recipient and sender addresses are never written to the output or the log — only their count. providerMessage is the provider's own error text with addresses and secrets removed.

Status

StatusMeaningRun ends as
sentThe provider accepted the email.Succeeded
dry_runRendered and saved, not sent.Succeeded
skipped_empty0 rows and skipIfEmpty is on. Not sent.Succeeded
failedNot sent. reasons says why.Failed

A failed run still writes its result row first, then ends as Failed so integrations, schedules and monitoring notice it.

Reason codes

Informational (the run did not fail because of them):

CodeMeaning
EMPTY_DATASETThe source had 0 rows.
ROWS_TRUNCATED_AT_MAX_ROWSThe source had more rows than maxRows; only the first maxRows were sent.
ATTACHMENT_TOO_LARGE_LINKEDAttachments exceeded maxAttachmentMb; they were left out and dataset download links were added to the body.
ATTACHMENT_TOO_LARGE_OMITTEDAttachments exceeded maxAttachmentMb and were left out; no link could be added (data came from rows, or fields/omitFields use nested names that a link cannot reproduce).
XLSX_CELLS_TRUNCATEDA cell was longer than Excel's 32,767-character limit and was cut in the XLSX file.
SOME_RECIPIENTS_REJECTEDSMTP only: the server accepted the email for some recipients and rejected others. See rejectedRecipientCount.
ROWS_IGNORED_FOR_INTEGRATIONThe run was triggered by an integration, so the dataset of the triggering run was used and rows was ignored.
CHARGE_FAILEDThe email was sent but the charge could not be recorded; charged is false.

Failures (status failed, nothing charged):

CodeMeaningRetried
INVALID_INPUTA field is missing or malformed. message names the field.no
UNSAFE_SMTP_HOSTsmtpHost is, or resolves to, a private, loopback, link-local or internal address.no
DATASET_NOT_FOUNDNo dataset with that ID.no
DATASET_READ_FAILEDThe dataset could not be opened or read.no
BUDGET_EXCEEDEDThe run's maximum cost does not cover one email.no
RUN_RESTARTED_NOT_RESENTThe run was restarted after it began sending. It was not sent again, to avoid a duplicate.no
AUTH_FAILEDThe provider rejected the user name, password or API key.no
PERMISSION_DENIEDThe key is valid but may not send this email (unverified sender or domain, restricted key, test-only account).no
SENDER_REJECTEDSMTP: the server rejected the from address.no
RECIPIENT_REJECTEDThe provider rejected the recipients.no
REQUEST_REJECTEDThe provider rejected the request as invalid (HTTP 4xx other than the codes above, typically 400, 404 or 422).no
MESSAGE_TOO_LARGEThe provider rejected the email as too large.no
CONNECTION_FAILEDThe server or API could not be reached, or TLS could not be established.yes, except DNS and TLS failures
RATE_LIMITEDThe provider's rate limit was hit (HTTP 429).yes
PROVIDER_ERRORThe provider failed (HTTP 5xx, or an SMTP error not covered above).yes, except permanent SMTP errors (5xx)
UNEXPECTED_ERRORAnything else.no

Retried failures are tried again at most 2 times (3 attempts in total), honouring Retry-After up to 30 seconds. Authentication and recipient failures are never retried.

Attachments

  • CSV — UTF-8 with BOM, comma-separated, CRLF line ends, RFC 4180 quoting. Text that starts with =, +, -, @, tab or carriage return gets a leading ' so spreadsheet programs do not run it as a formula (plain numbers such as -12.5 are left alone). You will see that ' in the cell.
  • XLSX — one sheet named Data, bold frozen header row. Numbers and booleans keep their type; all text is stored as text, so formula-like values are shown, not run. Cells longer than 32,767 characters are cut.
  • JSON — the original items, untouched. If you set fields or omitFields, it holds the same flattened columns as the CSV instead.
  • Nested objects become dot-notation columns (details.color). Lists of text or numbers are joined with , . Lists of objects become JSON text.
  • Files are named after the source Actor and the date, for example shop-scraper-2026-11-12.csv (dataset-2026-11-12.csv when the Actor is unknown).
  • With 0 rows no file is attached.

Limits

  • 20 recipients per run across to, cc and bcc. One run sends one email. Not for bulk, promotional or unsolicited email — use it for reports and alerts to people who expect them.
  • Rows: maxRows defaults to 10,000 and can be raised to 100,000.
  • Attachment size: maxAttachmentMb defaults to 10 MB and can be raised to 20 MB (total of all files, before email encoding, which adds about a third). Your provider may allow less; Gmail, for example, limits a message to 25 MB. Above the limit the attachments are replaced by download links.
  • Download links point to the Apify dataset API. They work for anyone who has the link unless your account restricts access to storages, and they stop working when the dataset expires under your data-retention setting.
  • SMTP: only ports 25, 465, 587 and 2525; TLS is required (implicit on 465, STARTTLS elsewhere); servers on private, loopback, link-local or internal addresses are refused.
  • Preview table: at most 100 rows and 8 columns, 120 characters per cell. The attachments hold everything.
  • Delivery is your provider's job. sent means the provider accepted the email. Bounces, spam filtering and delivery reports stay in your provider's dashboard.
  • A retry after a timeout can, rarely, deliver twice if the first attempt was accepted but its answer was lost. Resend requests carry an idempotency key to prevent this.
  • Email addresses with non-ASCII domain names are not accepted; use the punycode form.

How is this different from apify/send-mail?

apify/send-mail is Apify's own free Actor for sending a notification email. According to its README (read on 2026-11-12):

apify/send-mailDataset to Email
SenderIts input has no sender fieldYour own address, through your SMTP or email API account
Recipients on the Apify free planOnly the email address of your own Apify accountAny address your provider accepts, up to 20 per run
Recipients on paid plansUp to 20Up to 20 per run
Dataset as attachmentYou supply each attachment yourself as a base64 stringBuilt from the dataset: CSV, XLSX, JSON
BodyThe text or HTML you supplyDefault summary and preview table, or your own text and HTML with placeholders
PriceFree (you pay platform usage)$0.005 per email sent

If you only need a plain notification to your own address, apify/send-mail does that for free.

For agents and MCP clients

Minimal input to send a small table:

{
"to": ["team@example.com"],
"from": "Reports <reports@yourdomain.com>",
"rows": [{ "name": "Ann", "score": 9 }],
"provider": "resend",
"apiKey": "<key>"
}

Read the result from the OUTPUT record or the single dataset item: check status, then reasons. Add "dryRun": true to check the rendering first; no key is needed for that.

License

MIT