Skip to content

GreenCobalt/emailParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs Email Parser

BREAKING CHANGES - see changes section

A simple MIME email parser for nodejs applications.

Takes raw emails and parses out text and attachments.

Usage

const emailParser = require('emailparser');

let email = ` [ raw email text ] `;

let parsedEmail = emailParser.parseEmail(email);
console.log(parsedEmail);

/*
{
    "attachments": [],
    "content": [
        { ... }
    ],
    "headers": {
        "date": 0,
        "from": { "parsed": "[email protected]", "raw": "Test1 <[email protected]>" },
        "to": [{ "parsed": "[email protected]", "raw": "[email protected]" }],
        "subject": "email test"
    }
}
*/

Changes

0.0.17 - BREAKING

parseEmail(body) returned Object:

  • headers field changed to include all raw email headers, no parsing
  • previous headers now appear in meta field - has specific parsed headers: to, from, etc

About

A simple MIME email parser for nodejs applications.

Resources

Stars

Watchers

Forks