Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jorge_F_1
Beginner
55 Views

cordova.plugins.email.open - HELP-ME

Personally, I need some help, I am new to android and Intel XDK. See my code below. I can not send email. Where am I going wrong? because the code produces no effect ?. I am using Intel XDK version 3400 and the plug-cord-mail ... My smartphone is moto g, android. please help me. Thank you.

<Script>
     document.addEventListener ('deviceready', function () {
     // Cordova.plugins.email is now available
}, False);

cordova.plugins.email.isAvailable (
     function (isAvailable) {
     // Alert ( 'Service is not available') unless isAvailable;
     }
);
</ Script>
    
<Button onclick = "mail ()"> Email </ button>

<Script>
email function () {
     alert ( 'ok')
     cordova.plugins.email.open ({
     to 'luisv77@bol.com.br'
     subject: 'Greetings'
     body: 'Hello How are you?'
     });
}
</ Script>

Tags (2)
0 Kudos
2 Replies
Dale_S_Intel
Employee
55 Views

There's a few things I see here.

First, you may not need a Cordova plugin for this.  If you use a "mailto" link, that might be all you need, i.e.:

 

<a href="mailto:foo@bar.com"><button>Click here</button></a>

Additionally, you're calling a function "mail()", but haven't defined it anywhere, and further down you're creating a function by saying "email function ()" which should cause a syntax error.  It should be either "email = function ()" or "function email()", but either one creates a function "email" not "mail.

I would try the 'mailto' link.

 

Jorge_F_1
Beginner
55 Views

My friend, no.

Already I rummaged through a lot, trying to find a solution for email sent from an application developed in Intel XDK, but unfortunately did not find any. My suggestion in this forum would suggest, ask to develop a step-by-step, if possible with video of an example showing how this could be done. I'm already in version 3400 Intel XDK, work or how to pray.

Reply