Guest User

Untitled

a guest
May 29th, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. app.post('/contact', function (req, res) {
  2. let mailOpts, smtpTrans;
  3. smtpTrans = nodemailer.createTransport({
  4. servic: 'gmail',
  5. auth: {
  6. user: 'randomemail',
  7. pass: 'password'
  8. }
  9. });
  10. mailOpts = {
  11. from: req.body.name + ' <' + req.body.email + '>',
  12. to: 'jrodwod@gmail.com',
  13. subject: 'New message from contact form at your portfolio page',
  14. text: `${req.body.name} (${req.body.email}) says: n n ${req.body.message}`
  15. };
  16. smtpTrans.sendMail(mailOpts, function (error, response) {
  17. if (error) {
  18. res.render('contact-failure');
  19. }
  20. else {
  21. res.send(response);
  22. }
  23. });
  24. });```
  25.  
  26. 2018-05-29T06:31:32.280501+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/contact" host=desolate-journey-40239.herokuapp.com request_id=4c462f91-9f47-4566-943a-2c5e24d795ac fwd="75.74.137.60" dyno=web.1 connect=0ms service=89ms status=503 bytes=0 protocol=https
Add Comment
Please, Sign In to add comment