moved email construction into loop