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

184
Visualizações
Email sent with JavaScript not sending

Here is my code, It takes input from user and sends an email as them. it was working fine, but it stopped working, does anyone know why?

function othername() {
  var input = document.getElementById("userInput").value;
}

function pass() {
  var password = document.getElementById("password").value;
  return password;
}

function sendEmail() {
  Email.send({
    Host: "smtp.gmail.com",
    Username: othername(),
    Password: pass(),
    To: 'person@gmail.com',
    From: othername(),
    Subject: "Sending Email using javascript",
    Body: "This email was sent with javascript :)",
  })
  .then(function(message) {
    alert("mail sent successfully")
  });
};
<script src="https://smtpjs.com/v3/smtp.js"></script>
<p style="position:absolute; top:50%; left:5%; width:40%;">Put in your email address:</p>
<p style="position:absolute; top:70%; left:5%; width:40%;">Put in your password(we do not save this, read more in our about page)</p>
<form id="form" onsubmit="return false;">
  <input style="position:absolute; top:60%; left:5%; width:40%;" type="text" id="userInput" placeholder="Example@gmail.com" />
  <input style="position:absolute; top:80%; left:5%; width:40%;" type="text" id="password" placeholder="example: 11223344" />
  <input style="position:absolute; top:90%; left:5%; width:40%;" type="submit" onclick="sendEmail()" />
</form>

Am I making some dumb mistake? I have done this in python and sometimes it doesn't send because I reached my send limit or gmail access limit, but I have not accessed it a lot. Thanks!

about 4 years ago · Juan Pablo Isaza
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