I am looking to incorporate a HTML contact form on my website and send an email without using PHP. I have attempted to use the Mandrill API to send a JSON message. However, despite setting up my function and calling it from the onsubmit
, I am not receiving any emails in my inbox.
function send() {
$.ajax({
type: "POST",
url: "https://mandrillapp.com/api/1.0/messages/send.json",
data: {
"key": "IL_tX9KjtDeZevJkN7YwHA",
"message": {
"text":document.getElementById("message").value,
"subject": "Contacto desde la web",
"from_email":document.getElementById("email").value,
"from_name": document.getElementById("name").value,
"to": [
{
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d3baa0b2b1b6bffda0b2bdb0bbb6a9fda0b2b6a993b4beb2babffdb0bcbe">[email protected]</a>",
"name": "Recipient Name",
"type": "to"
}
]
},
"async": false
}
});
alert("Thank you for contacting us.");
};