Added function to pages controller for sending email