2

Am getting this error every time i run my code node mail2.js * I have already install all modules but still getting this error

 throw err;
      ^
Error: Cannot find module '/Users/anuppanwar/Downloads/project/wetty/mail2.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

Here is my code

var ses = require('node-ses')
, client = ses.createClient({ key: 'my_key', secret:      'my_secreat_key', amazone: 'https://ec3-52-11-150-17.us-west-2.compute.amazonaws.com' });

// Give SES the details and let it construct the message for you.  
client.sendEmail({
to: 'anup.panwar36@gmail.com'
, from: 'anup.panwar36@gmail.com'
 , cc: 'theWickedWitch@nerds.net'
 , bcc: ['canAlsoBe@nArray.com', 'forrealz@.org']
 , subject: 'greetings'
 , message: 'your goes here'
 , altText: 'plain text'
  }, function (err, data, res) {
// ... i
   if(err) {
    throw err
  }
 if(data){
  console.log("data"+data);
}



});

Every time i run my code am getting the same throw error don't know why?

Anup Panwar
  • 293
  • 4
  • 11

1 Answers1

0

You haven't import mail2. You must import it.

var mail2 = require('mail2');

Mayur
  • 4,345
  • 3
  • 26
  • 40