---
id: gh-extension-email-raw
name: "extension-email-raw"
url: https://skills.yangsir.net/skill/gh-extension-email-raw
author: caffeinelabs
domain: ai-agent-external-interaction
tags: ["email", "communication", "multi-recipient", "messaging", "automation"]
install_count: 27400
rating: 4.60 (120 reviews)
github: https://github.com/caffeinelabs/skills/tree/main/skills/extension-email-raw
---

# extension-email-raw

> 此技能支持发送包含多个收件人（To）、抄送人（Cc）和密送人（Bcc）的电子邮件。它简化了向不同接收方类型发送结构化邮件的流程，例如会议提醒，显著提升了沟通效率和准确性，减少了手动操作可能导致的错误，确保信息准确传达。

**Stats**: 27,400 installs · 4.6/5 (120 reviews)

## Before / After 对比

### 多收件人邮件发送效率

**Before**:

用户或开发者需要手动管理和输入多个收件人、抄送人及密送人地址，容易出错且耗时，尤其是在需要区分不同接收方角色时，增加了邮件发送前的检查和确认工作量。

**After**:

该 Skill 自动化了多收件人邮件的发送过程，通过结构化输入一次性处理 To、Cc、Bcc 地址，大幅减少了手动操作时间，降低了因地址输入错误导致的沟通风险，确保邮件准确送达。

| Metric | Before | After | Change |
|---|---|---|---|
| 邮件发送准备时间 | 30分钟 | 5分钟 | -83% |

## Readme

# 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);
      };
    };
  };
};
```


---
*Source: https://skills.yangsir.net/skill/gh-extension-email-raw*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-extension-email-raw/markdown*