Sending e-mails via JavaScript API