I am making a contact form in JS using SMTP. but getting error HTTP 405. IDK whats the problem

  html, javascript, smtp

I am making a contact form in JS using SMTP. but getting error HTTP 405. IDK what’s the problem.

HTML

<div class="form-area">
                   <form class="form-submit-js" method="POST">
                       <input class="form name" type="text" placeholder="Name" ><br>
                       <input class="form email" type="email" placeholder="Email" ><br>
                       <textarea class="form message" type="text" placeholder="Message" rows="4"></textarea><br>
                       <input type="submit" class="contact-submit-button" onclick="sendEmail()" value="Submit"/>
                   </form>
               </div>

JS

function sendEmail() {
        Email.send({
        Host: "smtp.gmail.com",
        Username : "[email protected]",
        Password : "peuofkkuiqapazlq",
        To : '[email protected]',
        From : "[email protected]",
        Subject : "sent a message on your Portfolio",
        Body : "<email body>",
        }).then(
            (message)=>alert("mail sent successfully")
        );
        }

Please help me out

Source: Ask Javascript Questions

LEAVE A COMMENT