title: How can I get my Angular $http request to return a response? I've tried callback functions and promises
body: <p>Been stuck on this for hours now and I've tried every example I've come across without any success.</p>
  
  <p>I have a simple form on my portfolio that sends me an email when it's submitted. In that regard, it works perfectly. However, I want some kind of response so that I can display either a success or error message on the page so the user can tell that their message went through.</p>
  
  <p>Here is my controller code:</p>
  
  <pre><code>$scope.sendMail = function(name, address, message) {
      var deferred = $q.defer();
      $http({
        url: '/send',
        method: 'GET',
        params: {name: name, address: address, message: message}
      }).success(function(response) { 
        console.log('Worked!');
        deferred.resolve(response);
      }).error(function(response) {
        console.log('Did not work!');
        deferred.reject(response);
      });
      return deferred.promise;
    }
  </code></pre>
  
  <p>Here is where I'm sending the request in my node server.js file:</p>
  
  <pre><code>app.get('/send',function(req,res){
    var mailOptions={
      to : 'ClaytonAlanKinder@gmail.com',
      subject : 'Message from: ' + req.query.name + ' at ' + req.query.address,
      text : req.query.message
    }
    console.log(mailOptions);
    transporter.sendMail(mailOptions, function(error, info){
      if (error) {
        console.log(error);
      } else {
        console.log(info.response);
      }
    });
  });
  </code></pre>
  
  <p>I'm tried all sorts of returns, callbacks, defers, and promises, but nothing seems to be working.</p>
  
  <p>Any and all help would be greatly appreciated.</p>