Prolateral Consulting Ltd
Prolateral Consulting Ltd
Knowledgebase: outmail
How do I send an email using the outMail API in Javascript / jQuery?


How do I send an email using the outMail API in Javascript?
How do I send an email using the outMail API in jQuery?
How do I send an email in Javascript using a RESTful API?


The following example of code assumes you have already got a fully functional webserver and you have working knowledge of Javascript and the jQuery framework.

Example code outmail-api.html

<!DOCTYPE html>
    <title>outMail API - JavaScript / jQuery Example</title>
    <meta charset="UTF-8" />
    <script src=""></script>
  <script language="JavaScript">
   $(document).ready(function() {
     $("#btn").on("click", function() {
         url: "",
         method: "POST",
         headers: { "Content-Type": "application/json" },
         data: JSON.stringify({
           api_key: "YOUR-API-KEY-SECRET",
           to: ["Someone <>"],
           sender: "My Name <>",
           subject: "Sending via Outmail",
           text_body: "This is the text message body",
           html_body: "<body><h1>This is the message</h1></body>"

       .done(function(result) {

       .fail(function(err) {
         throw err;

  <a href="#" id="btn"><h1>Click me</h1> </a>



Summary of server details

API server

API server protocol


Outgoing server port

80 / 443

Authentication Type


(0 vote(s))
Not helpful

The Origin of this information may be internal or external to Prolateral Consulting Ltd. Prolateral makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Prolateral makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.