正在使用的相关库...
var bodyParser = require('body-parser'),
nodemailer = require('nodemailer'),
xoauth2 = require('xoauth2');
...击溃
router.post('/users/contact', function(req, res, next) {
res.render('../views/users/contact', {
title: 'Contact',
layout: 'userLayout.hbs',
username: req.user.username,
subject: req.body.subject,
content: req.body.content
});
});
我的转运选项cfg ...
var options = {
from: 'asd',
to: req.user.mail, <<--------- works fine under mongodb pulling from db...
|--------
subject: req.body.subject, <<__/ those 2 params aren't working.
text: req.body.content << \ i believe transporter isn't the problem.
| if i set regular transporter param strings
| it works fine...
}; |--------
我需要知道如何在模式上显示 req.body 变量,例如...... 用户请求输入主题和内容的联系模式。 表示主题的1个输入和内容的1个textarea。 所以我当前的 req.body.subject 和内容返回 EMPTY 字段。 你的时间。 :
答案 0 :(得分:0)
正在使用的相关库...
var bodyParser = require('body-parser'),
nodemailer = require('nodemailer'),
xoauth2 = require('xoauth2');
...击溃
router.post('/users/contact', function(req, res, next) {
res.render('../views/users/contact', {
title: 'Contact',
layout: 'userLayout.hbs',
username: req.user.username,
subject: req.body.subject,
content: req.body.content
});
});
我的转运选项cfg ...
var options = {
from: 'asd',
to: req.user.mail, <<--------- works fine under mongodb pulling from db...
|--------
subject: req.body.subject, <<__/ those 2 params aren't working.
text: req.body.content << \ i believe transporter isn't the problem.
| if i set regular transporter param strings
| it works fine...
}; |--------
我需要知道如何在模式上显示 req.body 变量,例如...... 用户请求输入主题和内容的联系模式。 表示主题的1个输入和内容的1个textarea。 所以我当前的 req.body.subject 和内容返回 EMPTY 字段。 你的时间。 :