added error handling for email creation, added search and queue tables
added error handling for email creation, added search and queue tables