daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Apr 20th, 2018 205 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const spawn = require('threads').spawn;
  2. const thread = spawn(function(input, done) {
  3.  
  4.   const nodemailer = require("nodemailer");
  5.     let response ={};
  6.  
  7.             let transporter = nodemailer.createTransport({
  8.                 host: "smtp.gmgfgfgfgfl.com",
  9.                 port: 587,
  10.                 secure: false,
  11.                 auth: {user: "diegoaldoburlando62@gmail.com", pass: "**************"}
  12.             });  
  13.             let mailOptions = {
  14.                 from: "dieggfgfgfgfgfgfo62@gmail.com",
  15.                 to: "diegoalgfgfgfgfdoburlando62@gmail.com",           
  16.                 bcc:["diegoaldogfgfgfgfgfgfgfburlando62@gmail.com"],               
  17.                 subject: `Request of information`,
  18.                 text: "Attempt",   
  19.                 html: `<p>HELLO</p>`
  20.             };
  21.             transporter.sendMail(mailOptions, (error, info) => {
  22.                 if (error) {
  23.                     response.body = JSON.stringify({ message: error });                
  24.                     return;
  25.                 }          
  26.                 response.body = JSON.stringify({message: `Message sent`});
  27.         done({ result:'message sent' });
  28.             });
  29. });
  30.  
  31. thread
  32.   .send({ numSamples : 3000000 })
  33.   // The handlers come here: (none of them is mandatory)
  34.   .on('message', function(response) {
  35.     console.log('Outcome:', response.result);
  36.     thread.kill();
  37.   })
  38.   .on('error', function(error) {
  39.     console.error('Worker errored:', error);
  40.   })
  41.   .on('exit', function() {
  42.     console.log('Worker has been terminated.');
  43.   });
  44.  
  45.   console.log("Main thread proceding ahead");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top