fixing email deliver for production and test environments