encoding to email