Sending an email with syntax hightlighting for your source code

I resisted the switch to HTML e-mail for as long as I could, I know there are some who have managed to succeed in not switching to an HTML enabled email reader. But I just couldn’t hold out due to the fact that there were so many non-computer savvy people I communicated with who used it, and their e-mails were impossible to read without it, and I had to make the switch many years ago.

Since we’re all so used to reading code that has syntax highlighting in it, I like to have the source code contained in e-mails highlighted. Unfortunately, most syntax highlighters made for the web use CSS to style the code. And when you copy and paste the code into an email, the <style class=’…’> tags are copied, but not the actual style from the CSS, and what comes out on the other end is just text in the standard font. So the only way to get syntax highlighting in your email is to use a utility that embeds the styles into the HTML, rather than a CSS. I also wanted a utility that didn’t require me to save the source code and output as a file on my computer, creating a lot of unnecessary temp files that I’d probably never delete. So far, the only thing that actually fits the bill is this web based utility: http://tools.devshed.com/webmaster-tools/syntax-highlighting/

Basically, just paste your source code into the tiny little window, select the language, type the captcha, then cut and paste the result into your e-mail. It doesn’t have many options, and there’s lots of room for improvement, but it’s the best thing I’ve found so far.

Leave a Reply