making email a function