Switch to using built-in mail package
Make sending/receiving email much more robust, resolving most of the TODOs