aws-lambda-ses-forwarder
aws-lambda-ses-forwarder copied to clipboard
Unable to get the attachment using this code
Hi, I am unable to get the attachments through the Function to Email. Please help me to get rid of the problem.
How much memory did you allocate for your lambda function? You may want to check the CloudWatch log and see if the lambda function ran out of memory when trying to process your attachments.
Getting the following error, and Memory Allocation is 1024 MB and Timeout set to 5 minutes.
2018-07-25T12:12:30.497Z 86f450d6-9003-11e8-a0bb-65ebd8d8fb6e { level: 'error',
message: 'sendRawEmail() returned error.',
error:
{ InvalidParameterValue: Message length is more than 10485760 bytes long: '14727758'.
at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/query.js:47:29)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.
Unable to receive attachment more than 7 MB
SES limit is 10Mb per mail, after base64 encoding. Your message size is 14727758 = 14Mb
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html