SendRawEmailCommandでrawMessageを入れているのにValue null at 'rawMessage'と言われる
AWS LambdaのNodejs18環境で、@aws-sdk/client-sesをインポートしメールの送信をしようとしたところ設定しているはずの値がないと言われました。
ドキュメント通りに実装しているはずなのですが、指定の仕方に誤りなどがあれば教えていただきたいです。
コード
import { SESClient, SendRawEmailCommand } from "@aws-sdk/client-ses"
const params = {
source: 'メールアドレス',
rawMessage: {
data: 'メールデータ'
},
}
const command = new SendRawEmailCommand(params)
const client = new SESClient();
await client.send(command)
エラーメッセージ
{
"errorType": "ValidationError",
"errorMessage": "1 validation error detected: Value null at 'rawMessage' failed to satisfy constraint: Member must not be null",
"trace": [
"ValidationError: 1 validation error detected: Value null at 'rawMessage' failed to satisfy constraint: Member must not be null",
" at throwDefaultError (/var/runtime/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js:8:22)",
" at deserializeAws_querySendRawEmailCommandError (/var/runtime/node_modules/@aws-sdk/client-ses/dist-cjs/protocols/Aws_query.js:2609:51)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async /var/runtime/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24",
" at async /var/runtime/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js:13:20",
" at async StandardRetryStrategy.retry (/var/runtime/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js:51:46)",
" at async /var/runtime/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22",
" at async Runtime.handler (file:///var/task/index.mjs:96:3)"
]
}
0