Send Email avatar
Send Email
Try for free

No credit card required

View all Actors
Send Email

Send Email

apify/send-mail
Try for free

No credit card required

The actor automatically sends an email to a specific address. This actor is useful for notifications and reporting. With only 3 lines of javascript code, you'll be on top of your scraping actors and never miss important results or issues.

Apify Send Mail

Apify actor to send mail.

This actor is meant to be used as a reporting tool and must not be used to send promotional or spammy emails. Using it as such will lead to the user being banned on the Apify platform.

Input

Example:

1{
2    // Email address of the recipient(s) (e.g. "Apify <info@apify.com>")
3    // Required
4    to: String,
5    // Email CC same format as to
6    // Required
7    cc: String
8    // Email BCC same format as to
9    bcc: String
10    // Email subject
11    // Required
12    subject: String,
13    // Text body of Email
14    // Required
15    text: String,
16    // Email attachments
17    attachments: [Object]
18}

Attributes:

  • to - Email address of the recipient(s), you can comma-separate multiple addresses (e.g. "Apify info@apify.com" or "info@apify.com, hello@apify.com")
  • cc - Email CC same format as to
  • bcc - Email BCC same format as to
  • subject - Email subject
  • text - Text body of Email
  • html - HTML body of Email
  • replyTo - Email address which will be set when recipient will try to reply to mail. (Uses header Reply-To see doc)
  • attachments - array of attachments in base64 string, example:
1[{
2    // attachment file name
3    filename: String,
4    // attachment content in base64 string
5    data: String
6}]

Limitations

To prevent abuse, the actor limits the number of email recipients:

  • Users on the free plan can only send emails to their own email address associated with their Apify account.
  • Paying users can send emails to up to 20 different recipients.

Usage

From other Apify actor

1await Apify.call('apify/send-mail', {
2    to: 'test@apify.com',
3    subject: 'Test from act',
4    text: "Email text",
5    attachments: [{
6        filename: 'test.txt',
7        data: 'dGVzdCBzZmFzZGFzZGFzZGFzZA'
8    }]
9});

From Apify actor/task webhook

Calling this actor via a webhook is very handy because you can ensure it is sent only after specific event happens. Here is an example setup to send email after failed run.

  1. Open Webhooks tab of the actor/task that you want to monitor.
  2. Set Event types to Run failed and Run timed out.
  3. URL is the RUN API endpoint of this actor, just fill your API token - https://api.apify.com/v2/acts/apify~send-mail/runs?token=APIFY_API_TOKEN
  4. Payload template represents the body that is sent to this actor:

Example of payload that sends run ID in the email text:

1{
2    "to": "test@apify.com",
3    "subject": "Task Scrape-website run failed",
4    "text": {{eventData.actorRunId}}
5}
Developer
Maintained by Apify
Actor metrics
  • 224 monthly users
  • 91.1% runs succeeded
  • 1.6 days response time
  • Created in Sep 2017
  • Modified 7 months ago