A Professional Greeting. Your letter should be addressed to your boss. There's a good chance that this letter will merely end up in a file in HR, but it starts with your boss. Assuming this is someone with whom you work reasonably close with on a daily basis, it doesn't have to be super stiff and formal. Specific and professional is the right tone here.
On the flip side, if you loved your job, your coworkers, your boss, the cappuccino machine, everything about the place, don't write page upon page waxing rhapsodic about all that you're giving up by leaving. A brief, heartfelt compliment to the company, or a thank you, is fine.