---
title: "Comment by Codex Maximus on \"How to Build a Contact Form with JavaScript and NodeMailer\" | Hashnode"
description: "Thank you very much for sharing this! However, I have a small wonder. The code (completely copied from your example, with the only exception being the credentia"
url: "https://hashnode.com/posts/how-to-build-a-contact-form-with-javascript-and-nodemailer/5f3d05e179fdf532228edc72/comment/63b2b467d23d3c5ea6f522b1"
---

[Discussion](https://hashnode.com/posts/how-to-build-a-contact-form-with-javascript-and-nodemailer/5f3d05e179fdf532228edc72)

Comment [How to Build a Contact Form with JavaScript and NodeMailer](https://hashnode.com/posts/how-to-build-a-contact-form-with-javascript-and-nodemailer/5f3d05e179fdf532228edc72)

[Codex Maximus](https://hashnode.com/@CodexMax)

[Jan 2, 2023](https://hashnode.com/posts/how-to-build-a-contact-form-with-javascript-and-nodemailer/5f3d05e179fdf532228edc72/comment/63b2b467d23d3c5ea6f522b1)

Thank you very much for sharing this!

However, I have a small wonder. The code (completely copied from your example, with the only exception being the credentials) returns **405 Method Not Allowed**. The error is generated by fetch() in index.js, so server.js never runs.

The result is the same regardless of whether Live Server or Parcel server is used. However, by changing to node's server and to transporter.sendMail in the code, testing of the server.js file is succesful.

Have spent a few days on the matter, would be extremely grateful if you could point out the way (hints from articles like https :// blog.airbrake.io/blog/http-errors/405-method-not-allowed and the like do not help).

Thank you!

[Codex Maximus](https://hashnode.com/@CodexMax)

[Jan 3, 2023](https://hashnode.com/posts/how-to-build-a-contact-form-with-javascript-and-nodemailer/5f3d05e179fdf532228edc72/comment/63b2b467d23d3c5ea6f522b1#reply-63b3ed5392f96075bc858a4d)

Turns out Victoria Lo's code works great. Using node, solely.

I tried the solution here, as my own didn't seem to work. When Victoria's solution didn't work either, I became suspicious. Still I can't yet satisfactory answer my own question. But at least for new/old developers who found their way to javascript bundlers point out that local "help-servers" like Live Server and Parcels own don't always work as expected. Warnings and shown errors, does not necessarily mean that the code is "wrong". The mail-area is also not the only one where middlewares does not behave as expected. The matter is apparently known, and discussed on forums like GitHub.

So a reminder to myself, before spending weeks with endless troubleshooting and youtube videos: test the solution locally with node's own server first (alternatively on a web host). If the code then does not work, and only then, do I actually know that the error lies in the own code. Unfortunately, it is difficult to avoid bundlers such as gulp, parcel or webpack, but I can't trust them to much.

Again, thank you Victoria Lo for sharing your solutions and experiences!
