It's clear that your frustration at yourself runs quite deep and manifests itself in everything that you do. The email is just a symptom of a far bigger problem and hence it's unlikely that the fix is simple. However, that's not to say that you can't fight against the impulse to punish yourself. Sometimes you'll fail to do that but even just trying is a good start.
Nobody can be perfect in everything that they do and that is for a couple or reasons. Firstly, we're human, we're not robots. We can't repeat every action in the exact same way every single time. We learn, we improve, we change, we age, we move, we don't stand still. Every change makes a difference to the things that we do. It would be like trying to throw a dart at a moving dart board. Each time it moves we need to adjust and sometimes we will miss.
Secondly, perfection is subjective. What you might view as perfect I might view as less than perfect, or way more than I would call perfect. Yet another moving target. You might say that you have your own standards of perfection but they are bound to be influenced by the outside world. You can't live up to a standard that doesn't actually exist in any real sense that you can define. We're not talking about being perfect in one particular discipline here, you are asking yourself to be perfect in everything and that is trying to achieve a global standard where there is none.
Try and embrace your humanity. Our ability to adapt is what makes us so dominant as a species. If we didn't make mistakes then we'd never learn and we'd never grow. We'd never do things differently. We'd stand still. We'd be robots. When you make a mistake just forgive yourself for being human and resolve to do better next time. Most of all, don't forget that genuine intent to do right is worth an awful lot in itself. If you don't always hit the mark at least you can always say that you tried to and intended to.