Problem in production with nodemailer

The server.js is this site is doing nothing. If you recall the discussion from here where you set the publish directory to public, this means that anything at the root of the repository is not deployed. Only the static assets inside the public directory are deployed and served.

The same with this new portfolio site, if you set the public directory as the publish directory in the build settings, the server.js file is ignored.

For this site, if you wish to have a function to send an email via nodemailer, create a netlify/functions directory at the root of the repository, and inside this place the function. Set the publish directory to public and Netlify will deploy this and automatically build and deploy the function(s).

As mentioned previously, you can use express js inside a serverless function if you desire.