London Calling

Ramblings of a software architect in London.

Tag Archive for email

Sending E-Mails (the longer than usual story)

http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

Very interesting article (fewer and farther between unfortunately these days) from Jeff Atwood about some of their experiences with building Stack Overflow and sending out mails and having them actually arrive! Quite pertinent as I’m currently working in a similar area.

Essentially, firstly send mail from your client to: check-auth@verifier.port25.com and get a free report on basically what you’re missing from your setup. You can do this over and over again to get a picture for how you’re progressing.

Obviously the article goes into detail, but in summary:

1. Make sure the computer sending the email has a Reverse PTR record

2. Configure DomainKeys Identified Mail in your DNS and code

3. Set up a SenderID record in your DNS

Basically they are all a combination of adding the correct TXT and PTR records to your domain names, as well as generating a public/private key pair, signing your mails with the private one and making the public part available via DNS.

They use a commercial piece of software called Mailbee.NET to do the signing work, but this is possible using good old SmtpClient with something like this: http://tinisles.blogspot.com/2009/09/sending-dkim-email-from-c.html.

Not production code by any stretch of the imagination, and some of the work he does to build a CN and do the actual signing could be done using the built-in BCL classes but you get the picture. I’ll post again when I have this working.