https://github.com/dbtek/angular-email-parser
RFC 822 email parser module for Angular JS.
https://github.com/dbtek/angular-email-parser
angular-email-parser angularjs email javascript parcer rfc-822
Last synced: about 1 year ago
JSON representation
RFC 822 email parser module for Angular JS.
- Host: GitHub
- URL: https://github.com/dbtek/angular-email-parser
- Owner: dbtek
- License: mit
- Created: 2014-06-25T15:21:28.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T06:41:19.000Z (almost 9 years ago)
- Last Synced: 2025-04-15T13:14:31.447Z (about 1 year ago)
- Topics: angular-email-parser, angularjs, email, javascript, parcer, rfc-822
- Language: JavaScript
- Size: 286 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
angular-email-parser [](https://travis-ci.org/dbtek/angular-email-parser)
====================
RFC 822 email parser module for Angular JS. Based on [header-parse.js](https://gist.github.com/whitelynx/2e44e2af82bb9f51230d).
### Install
Install via bower:
```bash
$ bower install angular-email-parser
````
Include js file and add dependency in your app.
```js
angular.module('myApp', ['emailParser']);
```
Use provider: `$parseEmail`.
### Usage
```js
$parseEmail(mail, strict, parse);
```
**Parameters**
```
- mail (String) - Email source in plain text
- strict (Boolean) Optional - `true` for strict RFC822 compliance (don't treat \n without \r as line breaks)
- parse (Boolean) Optional - `false` to disable actually parsing headers (just separate the header block and the body)
```
**Returns**
```js
{
body: 'mail body content',
headers: {
From: '',
To: [],
...
}
}
```
### Author
İsmail Demirbilek ([@dbtek](http://twitter.com/dbtek))
### License
[MIT](http://opensource.org/licenses/MIT)
### Credits
David Bronke - [header-parse.js](https://gist.github.com/whitelynx/2e44e2af82bb9f51230d)