Improved API for sendmail
Checked sending email on local version. Works fine