[英]sending an email with aws nodejs sdk (using the aws sdk nodejs docs)
我无法理解AWS NodeJs SDK文档。 具体来说,我正在尝试为sendmail方法生成示例json参数。 有人有用于sendmail的示例json结构,还是AWS提供了这些示例? 谢谢
编辑:我看到nodemailer包装SES。 我将尝试一下https://github.com/andris9/Nodemailer
使用nodejs AWS开发工具包发送电子邮件的过程如下所示:
var AWS = requires('aws-sdk');
AWS.config.update({region: 'us-east-1'});
var SES = new AWS.SES();
var params = {
Destination: {
ToAddresses : 'you@gmail.com'
},
Source: 'me@gmail.com',
Message: {
Body: {
Text: {
Data: 'Hello world'
}
},
Subject: {
Data: 'Hello world'
}
}
};
SES.sendEmail(params, , function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
详细文档在这里
nodemailer软件包使邮件更加容易。 仍然不确定AWS SES的json结构
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.