changes
This commit is contained in:
parent
7d2338c378
commit
b33c5bb0e8
45
app.js
45
app.js
@ -10,6 +10,13 @@ app.use(express.cookieParser());
|
|||||||
app.use(express.static(__dirname + '/public'));
|
app.use(express.static(__dirname + '/public'));
|
||||||
app.use(express.bodyParser());
|
app.use(express.bodyParser());
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
aws: {
|
||||||
|
access: 'AKIAJAJN2G22O42XJODQ',
|
||||||
|
secret: 'Qqm8GL9vbSwrEFkQHgYouc0Ta5k0lD/xe3Xaf65Y',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// App
|
// App
|
||||||
|
|
||||||
/* Homepage */
|
/* Homepage */
|
||||||
@ -19,29 +26,29 @@ app.get('/', function(req, res) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var transport = nodemailer.createTransport("SES", {
|
||||||
|
AWSAccessKeyID: config.aws.access,
|
||||||
|
AWSSecretKey: config.aws.secret,
|
||||||
|
});
|
||||||
|
|
||||||
var transport = nodemailer.createTransport("Sendmail", "/usr/sbin/sendmail");
|
|
||||||
|
|
||||||
// Message object
|
var mailOptions = {
|
||||||
var message = {
|
transport: transport, // transport method to use
|
||||||
|
from: "testing@airtext.com", // sender address
|
||||||
// sender info
|
|
||||||
from: 'Bob <bob@airtext.com>',
|
|
||||||
|
|
||||||
// Comma separated list of recipients
|
|
||||||
to: '9147727429@vtext.com',
|
to: '9147727429@vtext.com',
|
||||||
subject: '',
|
subject: '', // Subject line
|
||||||
text: 'Hello to myself!',
|
text: 'testtingg', // plaintext body
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
transport.sendMail(message, function(error){
|
|
||||||
if(error){
|
|
||||||
console.log('Error occured');
|
|
||||||
console.log(error.message);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
console.log('Message sent successfully!');
|
|
||||||
|
nodemailer.sendMail(mailOptions, function(error){
|
||||||
|
if (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log("Message sent!");
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
transport.close(function(){}); // shut down the connection pool
|
||||||
});
|
});
|
||||||
|
|
||||||
var port = process.env.PORT || 8080;
|
var port = process.env.PORT || 8080;
|
||||||
|
Loading…
Reference in New Issue
Block a user