Added (basic) support for outbound mails
Some improvements to the API.