Permalink
Browse files

added support for Node.js Windows versions v0.5.0 - v0.5.2 (skip chil…

…d_process)
  • Loading branch information...
andris9
andris9 committed Aug 3, 2011
1 parent a434ff9 commit 4dbb36a296af94cfbc9cc0b1c5eebd3acbaee585
Showing with 17 additions and 5 deletions.
  1. +1 −1 README.md
  2. +15 −3 lib/mail.js
  3. +1 −1 package.json
View
@@ -25,7 +25,7 @@ The source for Nodemailer is available at [GitHub](https://github.com/andris9/No
### Compatibility
-Nodemailer is fully compatible with Node.js versions 0.3.x, 0.4.x and 0.5.x on *nix and 0.5.3+ on Windows
+Nodemailer is fully compatible with Node.js versions 0.3.x, 0.4.x and 0.5.x on *nix and 0.5.x on Windows
Usage
-----
View
@@ -1,13 +1,20 @@
var SMTPClient = exports.SMTPClient = require("./smtp").SMTPClient,
mimelib = require("mimelib-noiconv"),
- exec = require('child_process').exec
util = require("util"),
- EventEmitter = require("events").EventEmitter
+ EventEmitter = require("events").EventEmitter,
+ exec;
+
+try{
+ exec = require('child_process').exec;
+}catch(E){
+ // probably on Windows Node.js v0.5.0 - v0.5.2
+}
+
/*
* Version constants
*/
var X_MAILER_NAME = "Nodemailer",
- X_MAILER_VERSION = "0.1.22; +http://www.nodemailer.org";
+ X_MAILER_VERSION = "0.1.23; +http://www.nodemailer.org";
/**
* mail
@@ -464,6 +471,11 @@ EmailMessage.prototype.send = function(callback){
// use sendmail if set
if(exports.sendmail){
+
+ if(!exec){
+ return callback(new Error("No support for child processes in this version of Node.JS, use SMTP instead"));
+ }
+
var headers = this.generateHeaders(),
body = this.generateBody();
View
@@ -1,7 +1,7 @@
{
"name": "nodemailer",
"description": "Easy to use module to send e-mails, supports unicode and SSL/TLS",
- "version": "0.1.22",
+ "version": "0.1.23",
"author" : "Andris Reinman",
"maintainers":[
{

0 comments on commit 4dbb36a

Please sign in to comment.