ASP Hell

I’ve been in ASP Hell for the past 2 days. I inherited an app that a developer wrote a long time ago. Unfortunately, he’s no longer available for development, so I had to debug this code myself. And I’m not an ASP expert. I’ve been a developer long enough that most languages are at least familiar to me, and I can get around in them (particular editing existing code).

The problem I was having was that an odd line break was being inserted into the source code of an HTML email this app was generating. And it was always happening in the same place. I couldn’t for the life of me figure out why. I spent hours staring & reworking & escaping and doing everything I could think of to make this work, and still it didn’t help. Then someone (thanks Mike, Costas!) suggested I view the HTML on the server, and compared to the HTML in the email. And there was no problem on the server, so suddenly, we knew that the cause was in the mail server.

And so it was. The app is using the CDOSYS mail object, which was recommended (and indeed, is the only option on the server). Apparently, this PoS has a line limit length, and this mail was long enough to consistenly break the mail server. So it would randomly insert a line feed character, which would break the HTML email. So all I had to do, it turns out, is go and insert line feed characters all over the source (thus keeping the line lengths fairly short), and then it was happy. WTF?! I remember this being an issue in CF 3 & 4, but that was fixed several years ago.

Anyhoo, no more ASP for me for a while. From now on, I vow to give all shitty ASP code to my developers to work on, because it just makes me mad.