The problem I see is not the morality of the situation, but the poor handling.
By now everyone should know not to send questionable emails at work.
To do so, shows either a lack of intelligence or a lack or concern for one’s job. Either flaw is unacceptable for a professional position.