Check if maillist is empty

You dont want to process the data with each mail ?

If condition is to check the count alone to solve the error in easiest way. Once it has a count, We can loop those list and process each mail as per our requirement