Alter mail function