assume mail is an array