Fix multipart email rendering #6378

* Refactored mail construction for different cases
* Added tests to verify the constructed email.message
Merge pull request #233 from sharoonthomas/develop

Fix multipart email rendering #6378