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

385
Views
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 answers
Answer question

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 Report
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!