export to excel and send by email function