filling out the mail function