Changes in the mail function