Skip to content

Instantly share code, notes, and snippets.

@itswadesh
Last active March 27, 2017 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itswadesh/33d0755624e1a24e618dd3eba95c3a2a to your computer and use it in GitHub Desktop.
Save itswadesh/33d0755624e1a24e618dd3eba95c3a2a to your computer and use it in GitHub Desktop.
'use strict';
angular.module('sendmailApp', [])
.controller('MailController', function ($scope,$http) {
$scope.loading = false;
$scope.send = function (mail){
$scope.loading = true;
$http.post('/sendmail', {
from: 'CodeNx <admin@angularcode.com>',
to: 'support@codenx.com',
subject: 'Message from AngularCode',
text: mail.message
}).then(res=>{
$scope.loading = false;
$scope.serverMessage = 'Email sent successfully';
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment