Updated email code