https://github.com/davidcornu/mail-preview
Preview your Nodemailer emails in your browser.
https://github.com/davidcornu/mail-preview
Last synced: about 1 year ago
JSON representation
Preview your Nodemailer emails in your browser.
- Host: GitHub
- URL: https://github.com/davidcornu/mail-preview
- Owner: davidcornu
- Created: 2013-01-17T02:48:15.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-11-11T15:32:05.000Z (over 12 years ago)
- Last Synced: 2025-04-01T06:02:18.691Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/davidcornu/mail-preview
- Size: 158 KB
- Stars: 4
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mail Preview
Preview your [Nodemailer](https://github.com/andris9/Nodemailer) emails in your
browser (Inspired by [Letter Opener](https://github.com/ryanb/letter_opener)).
[](https://travis-ci.org/davidcornu/mail-preview)
## Usage
1. Install via [npm](https://npmjs.org)
```
$ npm install mail-preview
```
2. Use it with Nodemailer
```javascript
var nodemailer = require('nodemailer');
var path = require('path');
require('mail-preview');
var tmpdir = path.join(__dirname, 'tmp', 'nodemailer');
var transport = nodemailer.createTransport('MailPreview', {
dir: tmpdir, // defaults to ./tmp/nodemailer
browser: true // open sent email in browser (defaults to true)
});
```
Any emails sent through the `MailPreview` transport will be written to the
`tmpdir` and opened in a browser (unless `browser` is set to false).
## Development
Clone the repo
```
$ git clone git@github.com:davidcornu/mail-preview.git
```
Install dependencies
```
$ npm install
```
Run the tests
```
$ npm test
```