Improved email config script.