`SimpleMailSender` is not a public api. I don't recommend to use that directly, because there is a lot of special stuff done in ivy. E.g. port handling in the designer.
I made a sample on GitHub: [https://github.com/ivy-samples/mail-over-java-api-sample][1]
In this sample I show you how you could wrap the Mail Activity in a Sub Process with an own Java API. Because for now the most proper way to send mail in ivy is still over the mail step. You won't have any curious problems. In future - ivy should provide an java api to send mail (e.g. `ivy.mail`).
[1]: https://github.com/ivy-samples/mail-over-java-api-sample