Work Journal 2013-feb-05
Working from home with a baby who is still to sick to go to the nursery. Time to finish the prototype for Amazon SES, but first:
Today! From the Interwebs!
If you need cheering up - you should follow: @EmrgencyKittens (I assume you like cats). I also stumbled on a project that looks very interesting. No need to install (YAY!) - it's the portableapps.com project. I did try it out but got errors when trying to get the firefox and chrome browsers install. The idea is really good though and I will experiment a bit more with it.
Sending emails with Amazon SES
Yesterday I did some research on using Amazon SES and started on making a prototype for using the service from the project I'm working on.
It is really quite easy. Here's the code to send an email:
The host
, post
, smtpUserName
and smtpPassword
are configuration value (found in the AWS console under SES - smtpUserName
and smtpPassword
must be generated the first time.).
The toEmails.Replace(';', ',')
is a hack around the fact that the system used to integrate with Outlook clients. Outlook separates email addresses with ';' by default - SmtpClient
separates email addresses with ','. There is more to be said about SmtpClient
, but that will be a blogpost in it self.
Anyway, this is how an email is sent in general from .NET (except for the system specific details like an email always has exactly one attachment) and that is just really nice about Amazon SES.
Amazon SES Testing
But what about testing! I hear you say. Well, that's always the problem with system integrations. Here is how I did (with NUnit): Basically that means that I made sure the emails are send the same way every time and then I check the result manually.
Work Journal – a diary on what I did work/programming related today.