Created sendMessage function to be used for emailing