github twitter linkedin email rss
Amazon SES and my .Net port for scripts
Feb 2, 2011
3 minutes read

Intro

Amazon SES is not about third party tools to manage e-mail, they use their centralized system which has to authorize your sender e-mail and keeps all lists to keep a centralized filtering and send system much larger than any local tools could do (http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/Intro.ArchOverview.html)

It also strips the e-mail options to a minimum to focus on the deliverable of the messages and only has an API to work it - it is not a front-end tool.

On the SES page they talk about [http://litmus.com/ Litmus] as a more front-end AWS powered e-mail tools with filtering, previews, etc

“‘Default endpoint: https://email.us-east-1.amazonaws.com”’ (can be changed with a flag/api)

.net Port

I did a port for the current version of tools to .net on https://github.com/goncalopereira/Amazon-SES-.Net-scripts

This page is about the original Perl tools

Setup

Developer tools ( http://aws.amazon.com/developertools/Amazon-SES ) you’ll need perl and install a bunch of extra modules on their README file (SHA,URIEscape,LWP,Base64,SSLeay,LIbXML) ( http://www.brandonhutchinson.com/installing_perl_modules.html )

I’m not able to run some of the scripts with Strawberry Perl, looking into SES support forum some people seem to be having the same issue and another user as advised to use ActiveState Perl - using it myself

Cygwin Perl seems to crash on LibXML

example:

perl -MCPAN -e shell

i /JulianDay/

install Time::JulianDay

### Setup the AWS Credentials ( http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html?InitialSetup.Scripts.html )

Create text file with key and secret and set variable AWS_CREDENTIALS_FILE to file

ie set AWS_CREDENTIALS_FILE=aws-credentials.txt

you can also use the flag -k with the filename on the scripts

Verify sender e-mail/Manage verified list ( http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/InitialSetup.EmailVerification.html) Your e-mail needs to be verified to be used as a sender.

If you add/delete/list you might not get the latest list as it has some lag

While in development you can only send e-mails to the verified list

ses-verify-email-address.pl -k “REPLACE_HERE_CREDENTIAL_FILE” -v “REPLACE_HERE_EMAIL”

Check list of verified e-mails although the add/remove seem to work fine I’m not getting the list output unless I add the –verbose flag which outputs an e-mail response

ses-verify-email-address.pl -k “REPLACE_HERE_CREDENTIAL_FILE” -l

Delete e-mail from verified e-mails list

ses-verify-email-address.pl -k “REPLACE_HERE_CREDENTIAL_FILE’ -d ’'REPLACE_HERE_EMAIL”

### Sending an e-mail

you can send send an e-mail with the scripts, you need a comma separated list of receivers, your sender e-mail a file with the body and a subject

ses-send-email.pl -k “REPLACE_HERE_CREDENTIAL_FILE’ -s ”“SUBJECT”“ -f ’'SENDER_EMAIL” “’'EMAIL1,EMAIL2,EMAIL3”“ < ’'BODY_FILE”

if you feel like it you can also write the raw e-mail with all the options http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/SendingEmail.Raw.html

### Sender stats

ses-get-stats.pl -k aws-credentials -q –verbose

you can get the maximum number of e-emails you can send in 24h, and the ones already used up, again using verbose xml output as regular output doesn’t seem to work

ses-get-stats.pl -k aws-credentials -s –verbose

time detailed number of delivery attempts, and from those the number of rejected, bounced and complaints (to ISP)

SES will send e-mail messages per bounced e-mail back to the sender so these need to be checked regularly ( http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/ManagingActivity.Recommendations.html

### Scalability

SES scales with the number of e-mails that can be send, when in production the initial number of e-mails that a user can send in 24h keeps on growing to keep up with the increasing demand, the initial value is 1000 e-mails in 24h, for more than 1,000,000 it needs to be analysed by Amazon http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/ManagingActivity.PlanningAhead.html

If we need more than 1000 initial e-mails we need to split send batcher per day until it scales to a number that works in 24h - this isn’t handled by the scripts (there is no state only a dumb API)

### Links

http://aws.typepad.com/aws/2011/01/introducing-the-amazon-simple-email-service.html

http://aws.amazon.com/ses/

https://github.com/drewblas/aws-ses

http://www.powercram.com/2011/01/amazon-simple-email-service-on-windows.html

http://aws.amazon.com/sdkfornet/

### Documentation

http://docs.amazonwebservices.com/ses/latest/APIReference/

http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/


Back to posts