更新readme

master 2.0.0
yutent 2023-11-02 10:43:34 +08:00
parent b207971b6e
commit dd5a1cec86
1 changed files with 37 additions and 4 deletions

View File

@ -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 ```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: '<p>how are you?</p>'
})
```