I am using nodemailer to send emails using SES
const nodemailer = require('nodemailer')
const sesTransport = require('nodemailer-ses-transport')
const transporter = nodemailer.createTransport(sesTransport({
accessKeyId: '...',
secretAccessKey: '...',
region: 'us-east-1'
}))
When I try to send test emails from AWS SES Dashboard, it works. But when I send via code, it goes into spam. I've already followed the steps to "enable easy DKIM" http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html. When I check the verification status of DKIM on AWS Dashboard, its verified. Do I need to explicitly sign emails when sending via code? In the example from https://nodemailer.com/dkim/, I need a private key. Which private key isit? Where do I get it? Also what values do I put into domainName and keySelector?
let transporter = nodemailer.createTransport({
service: 'Gmail',
dkim: {
domainName: 'example.com',
keySelector: '2017',
privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBg...'
}
});