cleaned mail function