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