Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Formidable + CloudMailin
//MSG
app.post('/msg', function(req, res){
if (req.url == '/msg') {
var form = new formidable.IncomingForm(),
fields = [];
form.on('error', function(err) {
res.writeHead(200, {'content-type': 'text/plain'});
res.end('error:\n\n'+util.inspect(err));
}).on('field', function(field, value) {
fields.push([field, value]);
}).on('end', function() {
console.log('-> post done');
res.writeHead(200, {'content-type': 'text/plain'});
res.end('received fields:\n\n '+ util.inspect(fields));
//FROM
console.log(fields[2][1]);
//PLAIN
console.log(fields[5][1]);
//HTML
console.log(fields[6][1]);
});
form.parse(req);
} else {
res.writeHead(404, {'content-type': 'text/plain'});
res.end('404');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.