0
私のウェブサイトにamazon sesを使用して、私のウェブサイトから電子メールを送信しようとしています。私のアプリはnodejsを使って開発され、nodemail & nodemailer-ses-transportを使ってメールを送信します。しかし、次のエラーが表示されます。Amazon SESメールがnodemailerを使用して送信されない
{ AccessDenied: User `arn:aws:iam::755682848022:user/shajao.email' is not authorized to perform `ses:SendRawEmail' on resource `arn:aws:ses:us-east-1:755682848022:identity/shajao.com'
at Request.extractError (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/protocol/query.js:47:29)
at Request.callListeners (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
at Request.emit (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
at callNextListener (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
at IncomingMessage.onEnd (/Volumes/Zotac 120GB/6sense/printit/printit-backend/node_modules/aws-sdk/lib/event_listeners.js:269:13)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
message: 'User `arn:aws:iam::755682848022:user/shajao.email\' is not authorized to perform `ses:SendRawEmail\' on resource `arn:aws:ses:us-east-1:755682848022:identity/shajao.com\'',
code: 'AccessDenied',
time: 2017-12-25T10:49:05.129Z,
requestId: '39942938-e961-11e7-aa22-07070e500047',
statusCode: 403,
retryable: false,
retryDelay: 32.881228690068795 }
私のコードは次のとおりです。
AWSコンソールでIAMでユーザーを作成しvar transporter = nodemailer.createTransport(sesTransport({
accessKeyId: SESCREDENTIALS.accessKeyId,
secretAccessKey: SESCREDENTIALS.secretAccessKey,
rateLimit: 5
}));
var mailOptions = {
"from": "Shajao Customer Service<[email protected]>",
"to": to,
"subject": subject,
"text": text,
"html": html
};
transporter.sendMail(mailOptions, cb);
と私のアクセスキーIDとシークレットIDを追加しました。しかし、まだ動作していません。わからないどのように `SESを追加する:あなたはIAMにユーザーのポリシーまたはロールを配置する必要がありSendRawEmail \」