Simple Node.js powered webpage using Express, Jade and Nodemail. Template is using Bootstrap's Jumbotron page, slightly modified.
Make sure you are using Node.js 6.0.0 or higher
Install the modules with
npm install
Run the app with
node app
You can now access your webpage on localhost:3000
In the app.js file you find the configuration for the account the email is sent from in:
host: 'smtp.example.com',
port: '465',
secure: true,
//Credentials go here
auth: {
user: 'example@zoho.com',
pass: 'password'
}
host
: Your server's smtp address
port
: Usually 465 for SSL, 587 or 25 for STARTTLS
secure
: true
for port 465, false
for port 587
user
: Your login username
pass
: Your password
In mailOptions
your from
field should match your user.
Keep in mind services like Gmail require you to enable "Less Secure Apps". Read more here Allowing less secure apps to access Gmail