From dd5a1cec866db359f86c8f12918eb390b5ee28e4 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 2 Nov 2023 10:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 77191b0..099bc4e 100644 --- a/Readme.md +++ b/Readme.md @@ -1,12 +1,45 @@ -![module info](https://nodei.co/npm/@gm5/controller.png?downloads=true&downloadRank=true&stars=true) -# @gm5/controller +![downloads](https://img.shields.io/npm/dt/@gm5/mail.svg) +![version](https://img.shields.io/npm/v/@gm5/mail.svg) -> 控制器基类。 +# @gm5/mail + +> 一个简单的邮件发送模块, 可用于发送系统邮件, 如注册验证等。 ## 安装 ```bash -npm install @gm5/controller +npm i @gm5/mail ``` +## 使用 + +```js + +import { createApp } from '@gm5/code' +import { MailModule } from '@gm5/mail' + +var app = createApp() + +app.install(MailModule, { + auth: { + user: 'example@example.com', + username: 'example', + pass: '123456' + } + }) + .run() + + + +// in controller + +this.context.$$mail + .to('tom@xx.com', 'tom') + .send({ + subject: 'hello', + text: 'how are you?', + html: '

how are you?

' + }) + +``` \ No newline at end of file