Perhaps a single thread (sticky?) with posts on how to configure for various providers.
Figured out my AWS SES problem. For AWS, you can send email one of two ways, through the SMTP interface or through the AWD-SDK. Here is the rub, when using the SMTP you use the SMTP credentials, when using the SDK you use your AWS credentials.
Here are three code samples that I confirmed to work.
gmail:
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'Gmail',
auth: {
user: 'user@gmail.com',
pass: 'pw'
}});
AWS-SMTP:
npm install nodemailer-smtp-transport
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');
var transporter = nodemailer.createTransport(smtpTransport({
service: 'SES',
auth: {
user: 'AWS SMTP Key',
pass: 'Secret Key'
}
}));
AWS-SKD:
npm install nodemailer-ses-transport
var nodemailer = require('nodemailer');
var sesTransport = require('nodemailer-ses-transport');
var transporter = nodemailer.createTransport(sesTransport({
accessKeyId: "Main AWS Access Key",
secretAccessKey: "Secret Key,
rateLimit: 5 // do not send more than 5 messages in a second
}));
For all three cases:
transporter.sendMail({
from: 'info@maritimeopscorp.com',
to: req.query.to,
subject: req.query.subject,
text: req.query.text
},
function(err,info){
if(err){
res.send('error');
} else {
res.send('sent');
}
console.log(info);
console.log(err);
});