cordova-email-plugin
cordova-email-plugin copied to clipboard
Not able to attach .html data url file
I use the following code to attach the file, but it shows couldn't attach file.
cordova.plugins.email.open({
to: '[email protected]',
subject: 'Greetings',
body: '<h1>Nice greetings from Leipzig</h1>',
isHtml: true,
attachments: 'data:text/html;<html><head><title>This is sample text</title></head><body>Have a Nice day</body></html>'
});
In logcat for android error log
`2019-05-30 10:23:47.702 3519-3728/com.turkcell.tarim E/AndroidRuntime: FATAL EXCEPTION: pool-9-thread-3 Process: com.turkcell.tarim, PID: 3519 android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.sargin.demo1/cache/email_composer/demoexcel.xlsx exposed beyond app through ClipData.Item.getUri() at android.os.StrictMode.onFileUriExposed(StrictMode.java:1975) at android.net.Uri.checkFileUriExposed(Uri.java:2363) at android.content.ClipData.prepareToLeaveProcess(ClipData.java:941) at android.content.Intent.prepareToLeaveProcess(Intent.java:9944) at android.content.Intent.prepareToLeaveProcess(Intent.java:9950) at android.content.Intent.prepareToLeaveProcess(Intent.java:9929) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1622) at android.app.Activity.startActivityForResult(Activity.java:4762) at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:342) at android.app.Activity.startActivityForResult(Activity.java:4702) at org.apache.cordova.CordovaInterfaceImpl.startActivityForResult(CordovaInterfaceImpl.java:66) at de.martinreinhardt.cordova.plugins.email.EmailComposer$2.run(EmailComposer.java:154) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:784)
`