$cordovaEmailComposer can not send mail

Finally the problem is solved.:smiley:

To debug my code this time i use Visual Studio code and add a Cordova plugin in it
https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools

i remove my android platform and the all the mail sending libs.
Then run the following command again,
cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git
And then
ionic platform add android
I replace my code by the following,

$scope.SendMail=function(EmailAddr){
var email = {
to: EmailAddr,
subject: ‘Test Message’,
body: ‘This is a test message’,
isHtml: true
};
$cordovaEmailComposer.isAvailable().then(function() {
$cordovaEmailComposer.open(email).then(null, function () {
// user cancelled email
});
}, function () {
// not available
});
};

And it works.
Thanks everyone for the help and suggestion.
Happy Codding. :slight_smile:

1 Like