I admire the courage it takes to face this issue head-on and to write us here. I don’t believe you are on self-destruct — but I do thing what you are doing is self defeating. I believe your relationship is at a crisis point and writing your email is a very proactive way of dealing with it.
I would highly recommend couple counseling. The flirting is a symptom, not a cause. What I mean by this is that you are not looking toward the other person as a potential marriage partner, but rather the flirting is the result of a weak relationship with your husband. The only work that makes sense is to determine if your marriage has enough power to last.
Find a couple counselor and talk about what you need from your husband. Hopefully this will give you both something to work together on. But if the marriage doesn’t have the staying power you’d hoped for — at least you can move on knowing you’ve ended it directly and with integrity.