Retrieve emails for GUI from database