Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

427
Visualizações
emailJS POST https://api.emailjs.com/api/v1.0/email/send 400 reactjs

I have this problem 400. I use Emailjs i put the good id but form doesn't send. I don't understand why.I think is the problem with emailjs.min.js

error

index.html

email

Thank you for yours answers

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I looked at your index.html and I only see where you passed in your user ID. Can you post the part where you have to pull the form data from the html inputs and append them to a new Form object? This is more or less the main side of the code, I used jQuery to handle it. Example.

 $('#contact-form').on('submit', function(event) {
    event.preventDefault(); // prevent reload
    
    let formData = new FormData(this);
    formData.append('service_id', 'default_service');
    formData.append('template_id', 'template_mezfpy6');
    formData.append('user_id', 'user_ID');
 
    $.ajax('https://api.emailjs.com/api/v1.0/email/send-form', {
        type: 'POST',
        data: formData,
        contentType: false, // auto-detection
        processData: false // no need to parse formData to string
    }).done(function() {
        console.log('Your mail is sent!');
    }).fail(function(error) {
        alert('Oops... ' + JSON.stringify(error));
    });
});

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda