# 通过插件发送私信到邮箱地址

**URL:** <https://meta.discourse.org/t/send-pm-to-an-email-adress-from-a-plugin/280702>\
**Category:** Development\
**Created:** [2023 年10 月 2 日 06:06 UTC](https://meta.discourse.org/t/send-pm-to-an-email-adress-from-a-plugin/280702 "2023-10-02T06:06:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![Luicid](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/luicid/32/306711_2.png) [@Luicid](https://meta.discourse.org/u/Luicid)\
发布日期： [2023 年10 月 2 日 06:06 UTC](https://meta.discourse.org/t/send-pm-to-an-email-adress-from-a-plugin/280702/1 "2023-10-02T06:06:17Z")

</div>

你好，  
我正在构建一个插件，需要将一些内容发送到用户的电子邮件。  
我使用了

```plaintext
 creator = PostCreator.new(test_user, {
        target_recipients: "someone@toto.com",
        archetype: Archetype.private_message,
        subtype: TopicSubtype.system_message,
        title: "Hello test subject",
        raw: "This is the message. Does it work ?"
      })

```

_test\_user_ 是管理员

但是每次尝试发送时，我都会收到错误：  
**`主题为空`**

有什么想法吗？

---

_[View the full topic](https://meta.discourse.org/t/send-pm-to-an-email-adress-from-a-plugin/280702)._
