Project Entry 5: Node.js Mailer — Project Weekly Progress Report

This week is Week 5, let’s make our contact form work!!

It is Week 5, we already finished creating the skeleton of the front-end. And it is time to make some functions work. My weekly task is creating a server side mailer function and an endpoint for contact form in front-end.


Nodemailer is a module for Node.js applications to allow easy as cake email sending.

I follow their documentation with the SMTP configuration

  host: "",
  port: 587,
  secure: false, // upgrade later with STARTTLS
  auth: {
    user: "username",
    pass: "password"

And use verify method to valid my setting

// verify connection configuration
transporter.verify(function(error, success) {
  if (error) {
  } else {
    console.log("Server is ready to take our messages");

Use sendMail method to make the function work

    from: '',
    to: '',
    subject: 'Message',
    text: 'I hope this message gets delivered!'
}, (err, info) => {


Now I just need to create a endpoint for this function, so that Karla can request it in the front end.