问题描述
我正在使用nodemailer通过SES发送电子邮件
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'
}))
当我尝试从AWS SES仪表板发送测试电子邮件时,它可以工作.但是,当我通过代码发送邮件时,它就会变成垃圾邮件.我已经按照步骤启用简单的DKIM" http ://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html .当我在AWS Dashboard上检查DKIM的验证状态时,其已验证.通过代码发送时,我需要明确签署电子邮件吗?在 https://nodemailer.com/dkim/的示例中,我需要一个私钥.哪个私钥是?我在哪里得到的?还要在domainName和keySelector中输入什么值?
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...'
}
});
推荐答案
好的,我可以关闭它.看来nodemailer没有使用DKIM正确签名电子邮件.直接使用AWS SDK并调用setIdentityDkimEnabled
以启用DKIM可以修复问题.
Ok so I can close this. It appears nodemailer didnt correctly sign emails using DKIM. Using AWS SDK directly and calling setIdentityDkimEnabled
to enable DKIM fixes things.
这篇关于NodeJS的AWS SES没有DKIM签名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!