Comments (7)
Sending files directly from the file system is a bit buggy with Outlook, have you tried converting the files to base64 and attach them as base64? With me always works.
from cordova-plugin-email-composer.
Good suggestion thanks! i've just changed code in the app, i'm giving a feedback in the next couple of days.
from cordova-plugin-email-composer.
Problem seems to persist.
Yesterday stats were:
Total technicians using my app: 10
Total emails sent: 28
Total attachments sent: 41
Total missing attachments: 1
Here is a code example, am i doing something wrong?
Open file function to base 64:
function openFileToBase64(fileName) {
return new Promise(resolve => {
window.resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory + 'files/', function(dirEntry) {
dirEntry.getFile(fileName, { create: false }, function(fileEntry) {
fileEntry.file(function (file) {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = function() {
resolve(this.result);
};
}, function (err) { console.error('error getting fileentry file!' + err); });
});
});
});
}
Send email function:
async sendEmail() {
var filenames = ["28384_rapportino.pdf", "28383_rapportino.pdf"];
var files = [];
var base64file = '';
for (var x=0; x<filenames.length; x++) {
base64file = await openFileToBase64(filenames[x]);
base64file = base64file.split(",");
files.push("base64:" + filenames[x] + "//" + base64file[1]);
}
var email_ref_client = "[email protected]";
var email_cc = "[email protected]";
var subject = "Test";
var body = "PDF reports";
var email_client = "outlook";
cordova.plugins.email.open({
to: email_ref_client,
cc: email_cc,
subject: subject,
body: body,
app: email_client,
attachments: files,
}, function() {
window.location.href = 'main.html';
});
}
A couple of questions:
- Is there a way i can deeply debug the problem and somehow help?
- Is switching to Gmail app on all tablets and configure them to use office365 Exchange server a definitive solution to solve the problem?
from cordova-plugin-email-composer.
On a first glance you seem to do everything OK, this is what I use to convert images to base64 because in iOS the filesystem is also tricky. But your problem seems to reside in the fact that some files are not attached, which seems to be a different problem thus.
Yes, I would strongly suggest you to use Gmail instead, I'm using Gmail in Android for ages with this plugin and never had any issues. In Xiaomi devices you just have to activate MUI optimization to attach files.
If you want to deeply debug this plugin, we would deeply appreciate your PR. Check this file here, and this dir. You would need to know Java.
from cordova-plugin-email-composer.
Try also to search in the list of forks if everyone have already solved that issue
https://github.com/katzer/cordova-plugin-email-composer/network/members
If you find anything relevant, please do kindly share you results
from cordova-plugin-email-composer.
Is there a minimum Android version requirement? Could Android 7 be a problem despite using Gmail App ?
from cordova-plugin-email-composer.
Is there a minimum Android version requirement? Could Android 7 be a problem despite using Gmail App ?
I'm not aware of any. I am using this in Android 9, 10 and 11 it and works as expected.
The only restriction I've been seeing (Android 9, 10 and 11 + Gmail) is with Xiaomi devices wherein you have to activate MIUI optimization.
But yes, Android 7 is already quite old. Test it at least with 9.
from cordova-plugin-email-composer.
Related Issues (20)
- How to attach files in iOS? HOT 1
- 'Cordova/CDVAvailability.h' file not found HOT 1
- How to handle email sent or not ? HOT 1
- Application crush after try to open client HOT 27
- cordova-plugin-email-composer does not work on iOS 13+ HOT 26
- Email Composer not working for IOS 13+ HOT 5
- Failed to build in ionic project HOT 5
- On Android 11, emailComposer.open() do nothing nor call error HOT 9
- Calling .open() crushes the app with targetSdk set to 30 on Android HOT 17
- Closing the dialog by clicking outside of it does not complete the promise (iOS) HOT 1
- Crash on Samsung Galaxy A12 / Android 11 HOT 4
- Queries are not added to AndroidManifest.xml HOT 18
- package androidx.core.content does not exist Android HOT 5
- able to Open only mail in ios HOT 3
- EmailComposer.getPlugin.getClients is not a function
- Runtime exception HOT 3
- App getting crash as getEmailClientIds() return zero HOT 5
- Email blocked in outbox on mail app (iPhone) HOT 1
- java.lang.RuntimeException: Unable to start activity ComponentInfo{...}, Failed to create webview. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-email-composer.