Just putting your thoughts in an email WITHOUT clicking send can help. Save it. If you feel the need, go back and take a look next time you feel the urge to contact them. Maybe you'll build up a catalogue, kind of track your progress through the healing process. I do my best to just push them out of my head completely and do something that satisfies me in the meantime. I'll say, ok, I can think about them for the next ten minutes. If they pop back into my head after that I make a conscious effort to push them back out - wipe the blackboard clean.
I know the easy part is to type the email and the hard part is not to click send, but here's the deal. It's a swizz. The second you hit send you might have a little glow of satisfaction, but it's gone pretty quickly. Then you're left kicking yourself for losing all your control and dignity.