{"id":16549010,"url":"https://github.com/zhouzhi3859/egg-mail","last_synced_at":"2025-10-28T16:32:05.865Z","repository":{"id":57220602,"uuid":"109235506","full_name":"zhouzhi3859/egg-mail","owner":"zhouzhi3859","description":"a plugin for sendEmail of egg","archived":false,"fork":false,"pushed_at":"2019-04-26T09:39:41.000Z","size":27,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T16:48:02.253Z","etag":null,"topics":["egg","egg-mail","egg-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhouzhi3859.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-02T08:08:21.000Z","updated_at":"2022-09-01T03:19:37.000Z","dependencies_parsed_at":"2022-08-29T00:11:53.303Z","dependency_job_id":null,"html_url":"https://github.com/zhouzhi3859/egg-mail","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouzhi3859%2Fegg-mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouzhi3859%2Fegg-mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouzhi3859%2Fegg-mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouzhi3859%2Fegg-mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhouzhi3859","download_url":"https://codeload.github.com/zhouzhi3859/egg-mail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238681829,"owners_count":19512850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg","egg-mail","egg-plugin"],"created_at":"2024-10-11T19:27:51.872Z","updated_at":"2025-10-28T16:32:05.436Z","avatar_url":"https://github.com/zhouzhi3859.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-mail\n\n![](https://img.shields.io/badge/version-1.0.12-green.svg?)\n[![](https://img.shields.io/badge/nodejs-\u003e=8.0-green.svg?)](https://nodejs.org/en/)\n[![](https://img.shields.io/badge/npm-\u003e=5.4-blue.svg)](https://www.npmjs.com/)\n![](https://img.shields.io/badge/license-MIT-000000.svg)\n[![Build Status](https://www.travis-ci.org/zhouzhi3859/egg-mail.svg?branch=master)](https://www.travis-ci.org/zhouzhi3859/egg-mail)\n\nEmail smtp client based on emailjs for egg framework\n\n## Install\n\n```bash\n$ npm i egg-mail --save\n```\n\nEmail Plugin for egg, support egg application send email.\n\nThis plugin based on [emailjs](https://github.com/eleith/emailjs)\n\n## Configuration\n\nChange `${app_root}/config/plugin.js` to enable email plugin:\n\n```js\nexports.email = {\n  enable: true,\n  package: 'egg-mail',\n};\n```\n\nConfigure email information in `${app_root}/config/config.default.js`:\n\n**Single Client**\n\n```js\nconfig.email = {\n  user: *your email account*,\n  password: *your email password*,\n  host: *you email smtp server ip or domain name*,\n  sender: *what accout are you use to send email,like:XXX@XXX.com*,\n}\n```\n\n## Usage\n\nIn controller, you can use `app.email.sendEmail` to send email.\n\n```js\n// app/controller/home.js\nconst Controller = require('egg').Controller;\nclass HomeController extends Controller {\n  async index() {\n    const { ctx, app } = this;\n    // sendEmail\n    ctx.body = await app.email.sendEmail('Title','Content','Reciver');\n    // ctx.body = await app.email.sendEmail('test','testContent','test@test.com');\n    // or\n    // sendEmail with attachment\n    ctx.body = await app.email.sendEmail('Title','Content','Reciver','Attachment');\n    // ctx.body = await app.email.sendEmail('test','testContent','test@test.com', [ ... ]);\n  }\n};\nmodule.exports = HomeController;\n```\n\n## Example Attachment Array\n\n```\n[\n  {data:\"\u003chtml\u003ei \u003ci\u003ehope\u003c/i\u003e this works!\u003c/html\u003e\", alternative:true},\n  {path:\"path/to/file.zip\", type:\"application/zip\", name:\"renamed.zip\"}\n]\n```\nmore detail please click [here](https://github.com/eleith/emailjs#example-usage---html-emails-and-attachments)\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/zhouzhi3859/egg-mail/issues).\n\n## Typescript\nyou can visit this [example](https://github.com/zhouzhi3859/iMagazineServerTS).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhouzhi3859%2Fegg-mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhouzhi3859%2Fegg-mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhouzhi3859%2Fegg-mail/lists"}