Dear [your boss' name],
Please accept this letter as formal notification that I am resigning from my position as [position title] with [company name]. My last day will be [your last day—usually one month from the date you give notice].
Thank you so much for the opportunity to work in this position for the past [amount of time you've been in the role]. I've greatly enjoyed and appreciated the opportunities I've had to [a few of your favorite job responsibilities], and I've learned [a few specific things you've learned on the job], all of which I will take with me throughout my career.
During my last two weeks, I'll do everything possible to wrap up my duties and train other team members. Please let me know if there's anything else I can do to aid during the transition.
I wish the company continued success, and I hope to stay in touch in the future.