Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Tried logging into it, resetting my account and even creating new accounts but it didnt work

What I have tried:

XML
<!DOCTYPE html>
<html>
 
<head>
  <title>Sending Mail</title>
  <script src="https://smtpjs.com/v3/smtp.js"></script>
  <script type="text/javascript">
    function sendEmail() {
      Email.send({
        Host: "smtp.gmail.com",
        Username: "xxxxxxx@gmail.com",
        Password: "xxxxxxxx",
        To: 'yyyyyyyyy@gmail.com',
        From: "xxxxxxx@gmail.com",
        Subject: "Sending Email using javascript",
        Body: "Well that was easy!!",
      })
        .then(function (message) {
          alert("Mail has been sent successfully")
        });
    }
  </script>
</head>
 
<body>
  <form method="post">
    <input type="button" value="Send Mail"
        onclick="sendEmail()" />
  </form>
</body>
 
</html>
Posted
Updated 14-Jun-22 6:31am
v4
Comments
Jo_vb.net 14-Jun-22 9:03am    
this
To: 'yyyyyyyyy@gmail.com',
is different to the other code
try
To: "yyyyyyyyy@gmail.com",
Chris Copeland 14-Jun-22 9:37am    
What exactly isn't working? The code you've provided is to send a simple email (which, by the way, it's never safe to put your SMTP username and password in the Javascript on the web page; you should instead be sending emails in the server-side code where applicable) however your description seems to indicate issues with accounts?

If the issue is with the above JS code, have you considered using the developer tools of your browser to check the console and see whether you get an error message? Remember that JS promises also have a catch() method you can use to check for errors.
Richard MacCutchan 14-Jun-22 12:54pm    
Which Email client library are you using?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900