added loop to email send