I think it depends on the person you're thanking and the reason you thank them. In most cases I think it would be fine, but some people might think that sending an email is less formal, more casual; others won't mind. I think I would try to pick my words more carefully if I wrote a thank you email, to make sure it looks like I'm doing it with all the respect.