added support for sending emails
updated email functionality & added TODOs into code