It's grammatically correct, but you can also phrase it like this to avoid repeating "that":
When writing that email, I took into consideration Mr. Lee's inability to speak/understand English.
I would use "understand" instead of "speak", since Mr. Lee is reading the email, and not speaking to it.
Hope this helps! ^_^