If you still rely on this plugin, maybe try to remove the <html> tags, the plugin I used don’t require them so maybe in your plugin they destroy your context or something as well. Let me know if anything fixes your problem!
Ok I just tested it (iphone 5) and it works fine with your table.
You should test on a device, it won’t work on the simulator
Have you added the cordova plugin?
If you have deleted the images part from my tutorial, you might be having a } too much, so check/post your code.
Here the working one:
$scope.sendEmail = function() {
var TableF = "<h2>Look at my HTML!</h2>";
TableF += '';
TableF += '<table style="border:1px solid #000000;">';
TableF += '<tr>';
TableF += '<td>IP Addresses</td>';
TableF += '<td>Hop Number</td>';
TableF += '<td>Average MS</td>';
TableF += '</tr>';
TableF += '<tr>';
for(var i = 0; i <10 ; i++){
TableF += '<td>'+ 'IP'+i+'</td><td>' + 'Hop'+ i +'</td><td>' +'MS'+ i+'</td>';
TableF += '</tr>';
}
window.plugin.email.open({
to: ["your@mail.com"], // email addresses for TO field
cc: Array, // email addresses for CC field
bcc: Array, // email addresses for BCC field
attachments: null, // file paths or base64 data streams
subject: "Just some images", // subject of the email
body: TableF, // email body (for HTML, set isHtml to true)
isHtml: true, // indicats if the body is HTML or plain text
}, function () {
console.log('email view dismissed');
},
this);
};
1- yep, I tested it on android.
2- yes, I added cordova plugin, and there is “de.appplant.cordova.plugin.email-composer” folder in plugins folder
3- I test your code, but nothing happens when press "send mail " button
when I search about this error , I try to fix it with addition of
<script src="cordova.js"></script>
to the index …
but the error is still and new error appears ::
Error: Module org.apache.cordova.statusbar.statusbar does not exist.
throw new Error(‘Module ’ + moduleName + ’ does not exist.’);
I often get this error when adding plugins and not rebuilding the platform… Try to delete your android folder and add/prepare/build it again. If that still doesn’t help, I guess you must give some code to find the problem.
Ok so I just made a blank app, took your code but removed ngCordova from index and angular module as we don’t need it for the plugin, added the android platform and builded it to a device via USB and everything works.
I click send mail and a chooser for an email application appears. So the code works just as expected…Maybe there is something wrong with your ionic/cordova CLI? In that case try updating:
Are you definitely running the app native on android? You mentioned firebug, not sure about that…It still looks to mike like you have no cordova available at runtime which happens in the normal browser…
I did exactly as you did… made a blank app, took my code, and removed ngCordova from index, added android platform and builded it to a device via USB and nothing happens …
I have a question about EmailComposer plugin. It works perfectly but on Android when you call EmailComposer.open(…) it opens a popup displaying all social sharing app like (skype, twitter etc…).
In my case i must hide all social sharing app, i juste need to choose between mail client app.
So it it possible to hide social sharing options ?