Permalink
Browse files

forgot the example file

  • Loading branch information...
1 parent 572f646 commit 49b54be5f8bf96fc3ec634a4416391aabdb15af9 @substack committed Nov 29, 2011
Showing with 35 additions and 0 deletions.
  1. +35 −0 example/client.js
View
@@ -0,0 +1,35 @@
+var smtp = require('../');
+var seq = require('seq');
+var fs = require('fs');
+
+smtp.connect('localhost', 25, function (mail) {
+ seq()
+ .seq_(function (next) {
+ mail.on('greeting', function (code, lines) {
+ console.dir(lines);
+ next();
+ });
+ })
+ .seq(function (next) {
+ mail.helo('localhost', this.into('helo'));
+ })
+ .seq(function () {
+ mail.from('substack', this.into('from'));
+ })
+ .seq(function () {
+ mail.to('root', this.into('to'));
+ })
+ .seq(function () {
+ mail.data(this.into('data'))
+ })
+ .seq(function () {
+ mail.message(fs.createReadStream('/etc/issue'), this.into('message'));
+ })
+ .seq(function () {
+ mail.quit(this.into('quit'));
+ })
+ .seq(function () {
+ console.dir(this.vars);
+ })
+ ;
+});

0 comments on commit 49b54be

Please sign in to comment.