aws-lambda-ses-forwarder icon indicating copy to clipboard operation
aws-lambda-ses-forwarder copied to clipboard

Unable to get the attachment using this code

Open debmind opened this issue 5 years ago • 4 comments

Hi, I am unable to get the attachments through the Function to Email. Please help me to get rid of the problem.

debmind avatar Jul 23 '18 15:07 debmind

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.

zmingxie avatar Jul 23 '18 16:07 zmingxie

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. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12) at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18) message: 'Message length is more than 10485760 bytes long: '14727758'.', code: 'InvalidParameterValue', time: 2018-07-25T12:12:30.496Z, requestId: 'ffde72b5-9003-11e8-ae06-a1e66b2aa86f', statusCode: 400, retryable: false, retryDelay: 86.65018030266648 }, stack: 'InvalidParameterValue: Message length is more than 10485760 bytes long: '14727758'.\n at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/query.js:47:29)\n at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)\n at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)\n at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)\n at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)\n at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)\n at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10\n at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)\n at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)\n at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)' }

debmind avatar Jul 25 '18 13:07 debmind

Unable to receive attachment more than 7 MB

debmind avatar Jul 25 '18 13:07 debmind

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

sebsto avatar Feb 16 '19 12:02 sebsto