issue:moving report building code from mailReport() to createReport() #2

moved report creation logic to create report function