-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailer.js
35 lines (31 loc) · 961 Bytes
/
mailer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var mailer = (function(){
var node_mailer = require('nodemailer');
return {
send : function(msg,fn){
var options = {
service: 'Gmail',
host: 'smtp.gmail.com',
port: 465,
auth: {
user: 'k.simon.eriksson@gmail.com',
pass: '5olb8rmym0d53xjfgyq6prl8l8sn9v'
}
};
var transport_msg = {
to: 'k.simon.eriksson@gmail.com',
from: 'insiders@simoneriksson.org',
subject: 'Insider transaction occured',
text: msg
};
var transport = node_mailer.createTransport('SMTP', options);
transport.sendMail(transport_msg,function(error,response){
if(error){
console.log('Error sending mail:' +error);
}
fn(error);
});
}
}
});
var m = new mailer();
exports.mailer = m;