JSFiddle - React, Tailwind, and code Playground

by seefeld

HTML

<button id="btn">Click me</button>

JavaScript

$('#btn').click(function () {

    var data = {
        "FromName": "Piotr",
            "FromAddress": "[email protected]",
            "ToAddress": "[email protected]",
            "TextBody": "testowanie",
            "Subject": "testing"
    };


    $.ajax({
        type: "POST",
        beforeSend: function(xhr){
            xhr.setRequestHeader('Content-Type', 'application/json');
        }

        url: "https://api.emailyak.com/v1/anl0ufpw93evjuy/json/send/email/",
        data: data,
        success: function (response) {

            console.log(response);

        },
        dataType: "jsonp"
    });



});