There is some debate about the worth of an official two week notice. Some companies will automatically terminate the employee, and some employees believe it's too much of a courtesy to the employer they are leaving. However, that's exactly a reason to do it: it is a courtesy, and regardless of how the employer reacts, it speaks well of your professional standards. Find out the resignation policy of your company before you attempt to write any such letter. If the company does require or accept them, keep the letter short and concise.
Start with the date of the letter, followed by the name of the supervisor. In very direct terms, state the purpose of the letter in the first paragraph. For example:
Please accept this letter as my notice of resignation from (Company name), effective (insert the date two weeks from the previous date).
The rest of the letter must include information on how the company can contact you (so you can get your final check or other termination paperwork). It can include the reason you are leaving, an offer to help out with the transition, and a brief paragraph thanking the company for the opportunity. Do not make any negative comments. A potential employer could use this company as a reference.
Give the original letter or resignation to a direct supervisor and a copy to the Human Resources Department.