Category: Debugging

I've worked on a number of projects lately that have required the reviewing of HTML mail generated by ColdFusion's CFMail. In every development environment I've worked in the mail server is either 0.0.0.0 or there is a dummy mail gateway. In in either case knowing what the HTML will really look like can be difficult.

To help me with this issue I whipped up this very simple Adobe AIR app to help me look at the results. It's not a perfect solution and cannot account for the multitude of environments that the email will be viewed from, but it will render plain text and HTML emails close to what they would be viewed as in a mail client; it's also nice that to app is dead simple/basic.

Just point the app at your ColdFusion instance's "bad mail" folder and make sure your email server is set to 0.0.0.0 in CF Administrator

Please upgrade your Flash Player This is the content that would be shown if the user does not have Flash Player 6.0.65 or higher installed.


CFMail Viewer : Trunk - http://svn.empiregpservices.com/svn/OpenSource/CFMailViewer/trunk
CFMail Viewer : Branch 0.5.0 - http://svn.empiregpservices.com/svn/OpenSource/CFMailViewer/branches/0.5.0/

SVN Username = public
SVN Password = public

 

CFMail Viewer Screen Shot

I ran into this little gem this morning and I was stummped. FireBug wasn't even showing an attempt to call any images, ruling out server side issues since the image calls were plainly in the source code.

Turns out some how my local host got added to an exception list for loading images; I didn't even know FireFox had this feature.

  1. Tools » Options
  2. Content Tab
  3. Make sure Load Images is Cheked
  4. Click the respective Exceptions button
  5. Remove sites that shouldn't be in there

I had about 8 sites located in this exception list, all but one made no sense why they were there. I can only assume that there is some hot key or trigger that causes a site to get tossed into this bucket.

Are you using flash.net.FileReference's download function and having your download fail? I was too and it took stumbling on a flash kb article to get me on the right path.

My issue:private function downloadFile():void {
    var f:FileReference = new FileReference();
    f.addEventListener(Event.COMPLETE, myFnc);
    f.download(myURLRequest, strDefaultFileName);
}

This should work in my mind... However it does not. It will most likely fail with absolute silence.

Instead, init a globabl FileReference.private var fileRef:FileReference;

private function init():void {
    this.fileRef = new FileReference();
    this.fileRef.addEventListener(Event.COMPLETE, myFnc);
}

private function downloadFile():void {
    this.fileRef = new FileReference();
    this.fileRef.addEventListener(myURLRequest, strDefaultFileName);
}

This my friends will now work. It shouldn't require this code layout IMO, but it does...

I got caught up in a little gotcha last night that took me a few minutes to fully fix.

I use regex a lot, it's extremly powerful when used correctly. That said, sometimes I get tired of refreshing my page multiple times before I get something to work right... Enter "Eclipse Regular Expression Tester"; I've been running this for a couple days now and I've been pretty happy with it. So in case you never thought of getting something like this like me, I wanted to put this out there as a recomendation.

Usage was very simple, paste your multi-line content in the bottom box and type your expression into the top box. What ever your regex expression would select ends up getting highlighted down below... Pretty slick and super simple. No need for frills here.

Eclipse Regular Expression Tester

  1. Is your Flex builder throwing the error "Process terminated without establishing connection to debugger" when your try to launch your Air Application?
  2. Did you recently upgrade your SDK or the entire Flex Builder application, maybe to SDK 1.3?
  3. Are you working with a pre-existing project?

Open up your projects "projectName-app.xml" file in your source root. The second line will most likely be:
<application xmlns="http://ns.adobe.com/air/application/1.1">

Change it to:
<application xmlns="http://ns.adobe.com/air/application/1.5">

Your project should run just fine on recompile