forked from riegel/node.js-SMTP-server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
smtp.Server -- SMTP server (and soon, client) library and daemon for node.js | ||
============================================================================ | ||
|
||
## Synopsis | ||
|
||
An example of an SMTP server written with Node which dumps to the console | ||
any mail sent to it: | ||
|
||
var smtp = require('smtp') | ||
|
||
smtp.createServer(function(connection) { | ||
connection.on('DATA', function(message) { | ||
console.log('Message from ' + message.sender) | ||
message.on('data', function(data) { | ||
console.log("DATA: " + data) | ||
}) | ||
message.on('end', function() { | ||
console.log('EOT') | ||
}) | ||
}) | ||
}).listen(25) | ||
|
||
console.log("SMTP server running on port 25") | ||
|
||
## smtp.Server | ||
|
||
Ths main SMTP server constructor. Usually instantiated with | ||
`smtp.createServer` | ||
|
||
### smtp.createServer |