I am trying to send emails through javascript with smtp.js. If I open my website locally everything works fine, but if i host it on my domain it just stops working. How can I make it work?
function sendEmail() {
Email.send({
SecureToken: "5b51f40c-7d97-46db-a4d7-055bc8384828",
To: "contact@jayden.hu",
From: document.getElementById("input2").value,
Subject: "Contact",
Body:
"Name: " +
document.getElementById("input1").value +
"<br> E-mail: " +
document.getElementById("input2").value +
"<br> Message: " +
document.getElementById("input3").value,
}).then((message) => alert(message, type));
}
Error I get:
smtp.js:2 POST https://smtpjs.com/v3/smtpjs.aspx? net::ERR_INTERNET_DISCONNECTED
ajaxPost @ smtp.js:2
(anonymous) @ smtp.js:2
send @ smtp.js:2
sendEmail @ (index):185
onsubmit @ (index):139
smtp.js:2 POST https://smtpjs.com/v3/smtpjs.aspx? net::ERR_INTERNET_DISCONNECTED
ajaxPost @ smtp.js:2
(anonymous) @ smtp.js:2
send @ smtp.js:2
sendEmail @ (index):185
onsubmit @ (index):139