node-email-listener
所属分类:Email服务器
开发工具:CoffeeScript
文件大小:6KB
下载次数:0
上传日期:2014-02-25 08:54:46
上 传 者:
sh-1993
说明: 这将侦听服务器上的传入电子邮件,然后在成功时发出事件
(This will listen for incoming emails on a server and then emit an event on success)
文件列表:
.npmignore (33, 2014-02-25)
LICENSE (1098, 2014-02-25)
Makefile (64, 2014-02-25)
examples (0, 2014-02-25)
examples\richtext.coffee (2157, 2014-02-25)
index.js (34, 2014-02-25)
lib (0, 2014-02-25)
lib\index.js (2904, 2014-02-25)
package.json (735, 2014-02-25)
src (0, 2014-02-25)
src\index.coffee (2115, 2014-02-25)
#node.js email listener
This will allow you to create a simple email receiving server that will listen for new messages and then trigger an event. You can then parse through the message of the body any way you want.
[http://email-listener.nodejs.io/] (http://email-listener.nodejs.io/)
Use the link above to test the app.
##installation
```
npm install email-listener
```
##usage
```javascript
var emaillisten = require("email-listener");
//The optional argument will be the port to listen on
//(defaults to 25)
emaillisten.start();
//Listener Event
emaillisten.on("msg", function(recipient, rawbody, parsed){
//Whom the message is for
console.log(recipient);
//The raw contents of the message body
console.log(rawbody);
//This is the parsed message as an object with useful and easy ways to work with the message
console.log(parsed);
});
```
##parsed message
[https://github.com/andris9/mailparser] (https://github.com/andris9/mailparser)
This library is used to parse the message, please refer to it about what is returned in the `parsed` return in the callback. There will be more options to control this in future releases. For now, it just returns the parsed message with the default options.
近期下载者:
相关文件:
收藏者: