forked from stevestreza/node-pop3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated example to use authenticators
- Loading branch information
1 parent
1a259e8
commit 5695cc1
Showing
1 changed file
with
8 additions
and
6 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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
var sys = require('sys'); | ||
var pop3 = require('../lib/pop3'); | ||
|
||
var client = new pop3.POPClient(110, "localhost.com", "steve", "test"); | ||
var auth = pop3.POPClient.authentication.apop("steve", "test"); | ||
|
||
var client = new pop3.POPClient(110, "localhost.com", auth); | ||
client.addListener("authenticate", function(){ | ||
sys.puts("we have authenticated!"); | ||
client.sendAndWait(["STAT"], function(line){ | ||
sys.puts("stat: " + line); | ||
client.disconnect(); | ||
}) | ||
}) | ||
client.connect(); | ||
|
||
setTimeout(1000, function(){ | ||
client.disconnect(); | ||
}) | ||
client.connect(); |