我想从离子应用程序发送邮件,但代码无效。 使用this link
安装在插件下方下面是我的控制器代码
.controller('EmailSenderCtrl', function($scope, $cordovaEmailComposer) {
$scope.sendFeedback = function(){
cordova.plugins.email.isAvailable(
function (isAvailable) {
// alert('Service is not available') unless isAvailable;
cordova.plugins.email.open({
to: 'test@xyz.com',
cc: 'jane@doe.com',
subject: 'Feedback',
body: 'This app is awesome'
});
}
);
};
$scope.sendContactMail = function() {
alert("sendContactMail call");
//Plugin documentation here: http://ngcordova.com/docs/plugins/emailComposer/
$cordovaEmailComposer.isAvailable().then(function() {
// is available
alert("is available");
}, function () {
// not available
alert("Not available");
});
var email = {
to: 'abhay.sharma@ratufa.com',
cc: 'admin@ingredientapp.info',
bcc: ['admin@ingredientapp.info'],
subject: 'Cordova Icons',
body: 'How are you? Nice greetings from Leipzig',
isHtml: true
};
$cordovaEmailComposer.open(email).then(null, function () {
// user cancelled email
alert("Email Not compose");
});
alert("mail send");
};
})

这是我的HTML
<div class="send-email">
<button class="button button-outline button-block featured" ng-controller="EmailSenderCtrl" ng-click="sendContactMail()">
Send us an email
</button>
</div>
&#13;