Skip to content

Instantly share code, notes, and snippets.

@itswadesh
Last active Mar 27, 2017
Embed
What would you like to do?
'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