BIG HUGS Nicole.
It sounds to me like he is the one with issues, not you. Especially since he broke up with you over IM. Do not let him tell you that you have problems. He is no expert.
You will get through this and then be able to move on with the next part of your life. Go have a good cry, eat a pint of cookie dough ice cream, and if you think it might make you feel better, just to write that letter to him, but my advise, don't send it. At least not yet. Give yourself a few days to get over the shock then go back and reread it and decide then if you want to send it or not. If you do I would make this the last time you contact him. Let him step up and be a man and contact you.