Skip to content

Instantly share code, notes, and snippets.

@Marak
Created January 13, 2010 11:16
Show Gist options
  • Save Marak/276114 to your computer and use it in GitHub Desktop.
Save Marak/276114 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
tcp = require('tcp'),
debug = require('./debug');
var email = {};
email.send = function(){
var connection = tcp.createConnection('25', host="127.0.0.1");
connection.addListener("connect", function () {
connection.send('HELO localhost', encoding="ascii");
connection.send('MAIL From:[email protected]', encoding="ascii");
connection.send('RCPT To:[email protected]', encoding="ascii");
connection.send('DATA', encoding="ascii");
connection.send('hello marak i am the president.', encoding="ascii");
connection.send('QUIT', encoding="ascii");
connection.close();
// debug.log(connection);
});
};
exports.send = email.send;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment