modified mail parameters to all be in array