Added SSL to mail server connection
Fixed build for release
Minor refactoring

- Use dispose() on streams
- Some minor code styling