added mail fetching functionality