Итак, я пытаюсь настроить EmailJS для своего проекта. В настоящее время я получаю сообщение «FAILED» при отправке, но я не могу понять, почему? Любая помощь будет большим спасибо!
function sendMail(contactForm) {
emailjs.send("gmail", "rosie", {
"from_name": contactForm.name.value,
"from_email": contactForm.emailaddress.value,
"project_request": contactForm.projectsummary.value
})
.then(
function(response) {
console.info("SUCCESS", response);
},
function(error) {
console.info("FAILED", error);
}
);
return false; // To block from loading a new page
}
<form onsubmit = "return sendMail(this);">
<input type = "text" name = "name" class = "form-control" id = "fullname" placeholder = "Name" required/>
<input type = "text" name = "emailaddress" class = "form-control" id = "emailaddress" placeholder = "Email" required/>
<textarea rows = "5" name = "projectsummary" class = "form-control" id = "projectsummary" placeholder = "Project Description" required></textarea>
<button type = "submit" class = "btn btn-secondary center-block">Send Project Request</button>
</form>
В тексте ошибки говорится, что ваш идентификатор службы неверен. Поэтому вам нужно изменить свой идентификатор службы и заменить его чем-то на панели инструментов. Вам поможет следующая ссылка: https://www.emailjs.com/docs/rest-api/send/
проверьте правильность идентификатора службы. Сервер отвечает, что он недействителен.