building email funct.