converts a query to an email