addapted to support multiple emails