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

387
Visualizações
not receiving emails with smtpjs using elastic mail

So i am using javaScript to send form data to my email and am using smtpjs service with elastic mail authentication now everything is working fine but am not receiving the email here is the code:

        <form onsubmit="sendEmail(); reset(); return false;">
            <!--Account Information Start-->
            <h4 style="text-align: center;">أدخل رمز التفعيل</h4>
            <div class="input_group">
                <div class="input_box">
                    <input type="text" placeholder="رمز التفعيل" required class="name" id="code">
                    <i class="fa fa-user icon"></i>
                </div>
            </div> 
            <div class="input_group">
                <div class="input_box">
                    <button type="submit">تم</button>
                </div>
            </div>                
        </form>

<script src="https://smtpjs.com/v3/smtp.js"></script>  
    <script>
        function sendEmail() {
            Email.send({
            Host: "smtp.elasticemail.com",
            Username : "email@gmail.com",
            Password : "PASSWORD",
            To : 'email_2@gmail.com',
            From : document.getElementById("email"),
            Subject : "Code for " + document.getElementById("name").value,
            Body : "Code: "  + document.getElementById("name").value
            }).then(
                message => alert("mail sent successfully")
            );

      }

am not sure if am missing anything, i appreciate any help, Regards

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

0

I have found the solution if anyone wondering or have the same issue, in the sendEmail function the value of From should be an email that is verified by elastic mail :

       function sendEmail() {
        Email.send({
        Host: "smtp.elasticemail.com",
        Username : "email@gmail.com",
        Password : "PASSWORD",
        To : 'email_2@gmail.com',
        From : email@gmail.com, // put a real email address that is verified
        Subject : "Code for " + document.getElementById("name").value,
        Body : "Code: "  + document.getElementById("name").value
        }).then(
            message => alert("mail sent successfully")
        );
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