GithubHelp home page GithubHelp logo

nodecontactform's Introduction

Node Contact Form

Simple Node.js/Express app using Nodemailer to send emails

  • Please add your own SMTP info for it to work

Version

1.0.0

Install Dependencies

npm install 

Run

node app

nodecontactform's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodecontactform's Issues

exphbs is not a function

app.engine('handlebars', exphbs());
^

TypeError: exphbs is not a function
at Object. (C:\Users\91977\Desktop\nodecontactform-master\app.js:10:26)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47

Invalid login: 535-5.7.8 Username and Password not accepted.

facing issue from this line in app.js file:

let transporter = nodemailer.createTransport({ host: "smtp.gmail.com", port: 465, secure: true, // true for 465, false for other ports auth: { user: '****@gmail.com', pass: '*****' }, tls:{ rejectUnauthorized:false } });

and giving an error in the terminal

Server started...
{ Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials s68sm6561971pjb.38 - gsmtp
at SMTPConnection._formatError (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
at SMTPConnection._actionAUTHComplete (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:1523:34)
at SMTPConnection._responseActions.push.str (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:550:26)
at SMTPConnection._processResponse (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:942:20)
at SMTPConnection._onData (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
at TLSSocket.SMTPConnection._onSocketData.chunk (/home/rupb/Desktop/nodemail/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)
at TLSSocket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at TLSSocket.Readable.push (_stream_readable.js:224:10)
code: 'EAUTH',
response:
'535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8 https://support.google.com/mail/?p=BadCredentials s68sm6561971pjb.38 - gsmtp',
responseCode: 535,
command: 'AUTH PLAIN' }

My email id and password is correct but still facing this error.

Error: ENOENT: no such file or directory

If you get this error below
Error: ENOENT: no such file or directory

1-solution
A-Create views folder look like this:

views
|—— layouts
| |
| |—main.handlebars
|
|—concat.handlebars

B-Then
main.handlebars will be templated below

<!DOCTYPE html>
<html lang="en">
…
   <body>
     {{{body}}}
   </body>
</html>

concat.handlebars will be templated below

<div class="container">
   …..
</div>

Or

2-solution

in app.js use res.render('contact', {layout: false});
instead of res.render('contact');

server error

hey why iam getting this error
Error: ENOENT: no such file or directory, open 'C:\Users\HP\Desktop\f\nodecontactform-master\views\layouts\main.handlebars'
note: smtp details are updated

Error: Cannot find module 'express-handlebars'

This is what I get When I download, extract and type node app to run

module.js:549
throw err;
^

Error: Cannot find module 'express-handlebars'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\nam,e\Downloads\nodecontactform-master\nodecontactform-master\app.js:3:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.