You need to use "I'll write you an email."
In other comments, I think there's been a misunderstanding between what is correct and what is understandable. This is how it works:
"Write" can take two objects. A direct object (an email) and an indirect object (you).
If we choose the order [verb] [direct object] [indirect object], then we use "to" or "for" before the indirect object. "I'll write an email to you."
If we choose the order [verb] [indirect object] [direct object], which is also found in other European languages, then we don't need "to" or "for". "I'll write you an email."
This does not work for all verbs, remember. If the verb can naturally take an indirect object, you can put it between the verb and the direct object, without any preposition.