Here's a sample NC letter I found from another site:
Dear Other Person,
The relationship I had with you was thoughtless and selfish. It hurt many people, particularly my spouse, who did not deserve to be treated that way. I am committed to my marriage and determined to rebuild after all the hurt I’ve caused my family. I am going to work hard to be the husband/wife that he/she deserves.
Because of the terrible offense to my spouse and the damage I have done to both our marriage and our family, I am permanently ending all contact with you. Please respect my wish to regain my integrity and to heal my family. Please also respect my wish and do not attempt to contact me in any way at any time.
My spouse has all the details of our relationship and he/she will also be told of any attempts at contact.