Skip to content

Instantly share code, notes, and snippets.

@Voronenko
Created March 17, 2022 13:15
Show Gist options
  • Select an option

  • Save Voronenko/3ae71d48b19020b750b2d74ca033d003 to your computer and use it in GitHub Desktop.

Select an option

Save Voronenko/3ae71d48b19020b750b2d74ca033d003 to your computer and use it in GitHub Desktop.
dummy script to send file via SES
#!/bin/bash
sesAccess='AKIAXXXXXXXXXXXXXXXX' sesSecret='Bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
sesFromName="Joe McJones"
sesFromAddress="[email protected]"
sesToName="Mary McMary"
sesToAddress="[email protected]"
sesSubject="Test Email from Script"
sesSMTP="email-smtp.us-east-1.amazonaws.com"
sesPort="465"
sesMessage=$'Test of line 1\nTest of line 2'
sesFile="$1"
sesMIMEType=`file --mime-type "$sesFile" | sed 's/.*: //'`
curl -v --url smtps://$sesSMTP:$sesPort --ssl-reqd --mail-from $sesFromAddress --mail-rcpt $sesToAddress --user $sesAccess:$sesSecret -F '=(;type=multipart/mixed' -F "=$sesMessage;type=text/plain" -F "file=@$sesFile;type=$sesMIMEType;encoder=base64" -F '=)' -H "Subject: $sesSubject" -H "From: $sesFromName <$sesFromAddress>" -H "To: $sesToName <$sesToAddress>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment