Skip to content

Commit

Permalink
- begin api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aredridel committed Aug 22, 2010
1 parent b29f7d7 commit 31a00cf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions doc/api.markdown
@@ -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

0 comments on commit 31a00cf

Please sign in to comment.