0

I am trying to send emails from my client-side javascript however the function does not send the email. I do not know what I am doing wrong yet or is the feature disabled from Gmail? Here is my code

function sendEmail() {

      Email.send({
        Host: "smtp.gmail.com",
        Username: "myemail@gmail.com",
        Password: "password",
        To: "recepientemail",
        From: "myemail@gmail.com",
        Subject: "Subject",
        Body: "Hooray",
      })
        .then(function (message) {
          console.log("mail sent successfully")
        });
    
}

1 Answers1

0

You have to allow access to less secure apps in your gmail settings (This option will be available till 30th May 2022)

Slavi
  • 161
  • 1
  • 4