# extension-email-raw

Send an email with multiple to, cc and bcc addresses.

Skill by Caffeine. Category: Documents.

## Install

Project (for this project only):

```sh
npx skills add caffeinelabs/skills --skill extension-email-raw
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add caffeinelabs/skills --skill extension-email-raw -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass
- ZeroLeaks: Pass

Installs: 25210. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/caffeinelabs/skills/extension-email-raw)

## Source

[Open the source](https://github.com/caffeinelabs/skills/tree/HEAD/skills/extension-email-raw). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: extension-email-raw
description: Send an email with multiple to, cc and bcc addresses.
version: 0.1.7
compatibility:
  mops:
    caffeineai-email: "~0.3.0"
caffeineai-subscription: [plus, pro]
---

# Email — Raw Multi-Recipient
Raw multi-recipient email extension for [Caffeine AI](https://caffeine.ai?utm_source=caffeine-skill&utm_medium=referral).

## Overview

This skill adds support for sending emails with multiple `to`, `cc`, and `bcc` recipients. Not suitable for bulk service emails (recipients see each other).

# Backend

## This extension is for sending an email with support for multiple `to`, `cc` and `bcc` addresses.

- This should NOT be used for sending service emails to multiple users because each recipient will see all the other recipients listed which would typically be a breach of user privacy.

### For sending an email

- This extension depends on the [extension-email](../extension-email/SKILL.md) for sending emails.
- Use the sendRawEmail function. 
- It returns a SendResult which is #ok if the email is sent successfully otherwise #err(error) with the error text. 
- There can be a maximum of 50 recipients in total
- Each recipient receives the same email

```mo:caffeineai-email/emailClient.mo
module {
  public type SendResult = {
    #ok;
    #err : Text;
  };

  public func sendRawEmail(
    fromUsername : Text,
    to : [Text],
    cc : [Text],
    bcc : [Text],
    subject : Text,
    htmlBody : Text,
  ) : async SendResult;
};
```

### Example usage for sending an email reminder to meeting attendees.

```motoko filepath=src/backend/main.mo
import Runtime "mo:core/Runtime";
import EmailClient "mo:caffeineai-email/emailClient";

actor {
  public func sendMeetingReminder(
    meetingSubject : Text,
    meetingTime : Text,
    confirmedAttendeeEmails : [Text],
    tentativeAttendeeEmails : [Text],
  ) : async () {
    let result = await EmailClient.sendRawEmail(
      "no-reply",
      confirmedAttendeeEmails,
      tentativeAttendeeEmails,
      [],
      meetingSubject,
      "Reminder the meeting will start at " # meetingTime,
    );

    switch (result) {
      case (#ok) {};
      case (#err(error)) {
        Runtime.trap("Failed to send meeting reminder email: " # error);
      };
    };
  };
};
```

## Upgrading from the previous version

An app built with `caffeineai-email` 0.2.x re-pins with `mops add caffeineai-email@0.3.0`. `sendRawEmail` keeps their signatures; every send now carries an idempotency key, so a retried outcall is sent and charged once. Apps that use verification or marketing email follow the upgrade sections of those skills.
````

- Previous: [extension-user-approval](https://syn4pse.dev/terminal/caffeine-extension-user-approval.md)
- Next: [extension-http-outcalls](https://syn4pse.dev/terminal/caffeine-extension-http-outcalls.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
