Skip to content
Browse files

[misc] Added back demos, not sure why they got removed. Added colors …

…library. Bumped version
  • Loading branch information...
1 parent eace7c1 commit 2b5c67f5f4e923c7b79b3da4cd8a13d1122453cb @Marak committed Jan 24, 2011
Showing with 58 additions and 5 deletions.
  1. +1 −1 Readme.md
  2. +31 −0 demo-template.js
  3. +20 −0 demo.js
  4. +3 −2 lib/node_mailer.js
  5. +3 −2 package.json
View
2 Readme.md
@@ -1,4 +1,4 @@
-#v0.4.4
+#v0.4.51
<img src = "http://imgur.com/5Ol90.png"/><br/>
###send emails from node.js to your smtp server, simple as cake.
View
31 demo-template.js
@@ -0,0 +1,31 @@
+var email = require("./lib/node_mailer");
+
+for(var i = 0; i < 10; i++){
+
+ email.send({
+ host : "localhost", // smtp server hostname
+ port : "25", // smtp server port
+ domain : "localhost", // domain used by client to identify itself to server
+ to : "marak.squires@gmail.com",
+ from : "obama@whitehouse.gov",
+ subject : "node_mailer test email",
+ template : "../templates/sample.txt", // path to template name
+ data : {
+ "username": "Billy Bob",
+ "color": function(){
+ var arr = ["purple", "red", "green", "yello"];
+ return arr[Math.floor(Math.random()*3)];
+ },
+ "animal": "monkey",
+ "adverb": "quickly",
+ "noun": "hot lava"
+ },
+
+ authentication : "login", // auth login is supported; anything else is no auth
+ username : "dXNlcm5hbWU=", // Base64 encoded username
+ password : "cGFzc3dvcmQ=" // Base64 encoded password
+ },
+ function(err, result){
+ if(err){ console.log(err); }
+ });
+}
View
20 demo.js
@@ -0,0 +1,20 @@
+var email = require("./lib/node_mailer");
+
+for(var i = 0; i < 10; i++){
+
+ email.send({
+ host : "localhost", // smtp server hostname
+ port : "25", // smtp server port
+ domain : "localhost", // domain used by client to identify itself to server
+ to : "marak.squires@gmail.com",
+ from : "obama@whitehouse.gov",
+ subject : "node_mailer test email",
+ body: "Hello! This is a test of the node_mailer.",
+ authentication : "login", // auth login is supported; anything else is no auth
+ username : "dXNlcm5hbWU=", // Base64 encoded username
+ password : "cGFzc3dvcmQ=" // Base64 encoded password
+ },
+ function(err, result){
+ if(err){ console.log(err); }
+ });
+}
View
5 lib/node_mailer.js
@@ -26,6 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
var tcp = require('net'),
fs = require('fs'),
carrier = require('carrier'),
+ colors = require('colors'),
mustache = require('../vendor/mustache'),
defaultOptions = {
to : "marak.squires@gmail.com",
@@ -69,7 +70,7 @@ Connection.prototype = {
{
self.connect(function(err) {
if (err) {
- console.log(err);
+ console.log(err.red.bold);
return;
}
doProcess();
@@ -247,7 +248,7 @@ Connection.prototype = {
self.connect(function(err) {
if (err) {
// Probably process error
- console.log(err);
+ console.log(err.red.bold);
return;
}
process.nextTick(function() {
View
5 package.json
@@ -1,7 +1,7 @@
{
"name": "mailer",
"description": "send emails from node.js to a smtp server, simple as cake",
- "version": "0.4.5",
+ "version": "0.4.51",
"author": "Marak Squires",
"contributors" : [
"Elijah Insua <tmpvar@gmail.com> (http://tmvpar.com/)"
@@ -11,7 +11,8 @@
"url": "http://github.com/Marak/node_mailer.git"
},
"dependencies": {
- "carrier": ">= 0.0.4"
+ "carrier": ">= 0.0.4",
+ "colors": ">= 0.3.0"
},
"engine": [ "node >=0.1.90" ],
"main": "lib/node_mailer"

0 comments on commit 2b5c67f

Please sign in to comment.
Something went wrong with that request. Please try again.