Hi, i am new to AngularJS, and i am guessing my problem is real easy, thx 
for your patience! :)
 I am trying to include NodeMailer (to send emails!) in my AngularJS 
project. 
I have the code for my Nodemailer side but everytime i try to create 
service/factory on my angularJS project to have access to my Nodemailer 
code i lose references. 

Here is the Nodemailer code, and i wish to have the mailOptions object and 
the sendMail() methode available in my $scope. 
How do i structure my factory (app.js)  and controller (controller.js) 
 accordingly? All my attempts ended up losing ref to: 
 require("nodemailer").

Thank you for help..
var nodemailer = require("nodemailer");


var smtpTransport = nodemailer.createTransport("SMTP",{
    service: "Gmail",  
    auth: {
        user: "myaccount",
        pass: "mypwd"
    }
});
var mailOptions = {
    from: 'You ✔ <from @ gmail.com>',
     to: 'you ✔ <to @ gmail.com>',
    subject: 'Hello ✔', 
    text: 'Hello world ✔',
    html: '<b>Hello world ✔</b>'
};


smtpTransport.sendMail(mailOptions, function(error, info){
    if(error){
        console.log(error);
    }else{
        console.log('Message sent: ' + info.response);
    }


    smtpTransport.close();
});

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to