Last active
March 27, 2017 14:22
-
-
Save itswadesh/33d0755624e1a24e618dd3eba95c3a2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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