node.js - Trying to send message with gunmail, error -


tried following mailgun's nodejs tutorial, error:

error  { [error: <!doctype html public "-//w3c//dtd html 3.2 final//en"> <title>404 not found</title> <h1>not found</h1> <p>the requested url not found on server.</p><p>if entered url manually please check spelling , try again.</p> ] statuscode: 404 } undefined 

the code i'm using in node server looks this:

var express = require("express"); var expressapp = express(); var server = http.createserver(expressapp);  //port number server var portnum = process.env.port || 80;  var mailgun = require('mailgun-js');  //get requests expressapp     .get("/", function routehandler(req, res) {         res.sendfile(path.join(__dirname, "../client/index.html"));          var api_key = 'key-00000000000000000000';         var domain = "https://api.mailgun.net/v3/mydomain.com"; //i think error must here         var mailgun = new mailgun({apikey: api_key, domain: domain});          var data = {             from: "me@mydomain.com", //i tried me@samples.mailgun.org in example              to: 'myemail@gmail.com',             subject: 'hello',             text: 'testing mailgun awesomness!'         };          mailgun.messages().send(data, function (err, body) {             if (err) {                 console.log("error ", err);             }              console.log(body);         });       }) 

...

please have been stuck @ way time, there's not documentation node.js + mailgun


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo