JSON API for sending email