Skip to content

aws sesv2 send-mail raw for attachment failing with "argument too long"

0

I am trying to send email with attachment using cli. Any advise how to fix this. it worked when I was using smaller sample file

aws sesv2 send-email
--from-email-address $FROM
--destination "ToAddresses=$TO"
--content "Raw={Data=$(cat emailbase64.txt)}" -bash: /usr/bin/aws: Argument list too long

cat emailbase64.txt|wc -c 1802627

The size of emailbase64.tx is 1.8M

1 Answer
0
Accepted Answer

I was able to fix it by creating a json file and using it as input to the cli.

aws sesv2 send-email --cli-input-json file://email_payload.json

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.