Email generation fixed