Message from JavaScript discussions

September 2018

— And how can I hide the password of my mail? I have my whole site in GitHub

— 

* Make a form that POSTs urlencoded data
* Use express.urlencoded to decode that data
* Use nodemailer to send that data

— Use environment variables

— Nice, ty

— Windows:

set EMAIL_USER=meexample.com
set EMAIL_PASSWORD=abc123
npm run start


and in code:

nodemailer.createTransport({
user: process.env.EMAIL_USER,
password: process.env.EMAIL_PASSWORD
});

Message permanent page

— Something like that anyway

— To do the same on Linux / Mac, you just remove set

— What do you mean with urlencoded data? Coult it work like this?
<form action="" method="post" class="">
<input class="form-control" id="name" name="name" type="text" placeholder="Name *" required="required">
<textarea class="form-control" id="message" name="message" type="text" placeholder="Message *" required="required"></textarea>
</form>

Message permanent page

— Yep, looks good

— Https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#Example

— Here are some examples of urlencoded vs form-data

— The default is urlencoded