baturorkun / aws-ses-sender Goto Github PK
View Code? Open in Web Editor NEWSending an email with attachment by using Amazon SES Services.
Sending an email with attachment by using Amazon SES Services.
I was unable to get the script to work as-is and needed to make the following changes on macOS Big Sur:
Line 50: ATTACHMENT=base64 -i $ATTACHMENT
needs to change to: ATTACHMENT=base64 -e $ATTACHMENT
(note the replacement of the -i with -e ... it also works if you omit -e completely)
Line 65: add another line: sed -i -e "s/$(printf '\r')//g" $TMPFILE
(the script as written adds extra CR characters which make the JSON illegal). This removes those extra CRs.
Line 66: aws ses send-raw-email --raw-message file://$TMPFILE
needs to change to: aws ses send-raw-email --cli-binary-format raw-in-base64-out --raw-message file://$TMPFILE
Even after fixing these issues, this script still won't work with large attachments because sed simply can't deal with them. Refer: https://unix.stackexchange.com/questions/546906/sed-command-giving-argument-list-too-long-error
I liked the look of this and tried to use it to send a spreadsheet, I encountered the error: /usr/bin/sed: Argument list too long
when trying to do that. The spreadsheet is 200KB
I was trying to execute the following command:
sh ses_emailer.sh --subject "This is a sample email from pigeon server" --from "[email protected]" --receiver "[email protected]" --body "ses says hi" --attachment /var/www/sites/error_20200302.txt
Hence receiving the error sed: -e expression #1, char 91: unterminated
s' commandonce I am adding
--attachment /var/www/sites/error_20200302.txt`
I tested your script on both OSX and on AWS EC2 node (AWS Linux image)
I get Missing From in both cases.
/usr/local/opt/coreutils/libexec/gnubin/base64
An error occurred (InvalidParameterValue) when calling the SendRawEmail operation: Missing required header 'From'.```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.