Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send with attachments which are not .zip #48

Open
ghost opened this issue Jun 25, 2020 · 1 comment
Open

Send with attachments which are not .zip #48

ghost opened this issue Jun 25, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 25, 2020

Hi and thanks for your work!

My Flutter and Dart versions are:

Flutter 1.17.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b041144f83 (3 weeks ago) • 2020-06-04 09:26:11 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4

I want to send an email with a PDF/PNG/JPG as attachment(s).

My application downloads dynamically files from the internet and then I want to build a "share" button. My code is very simple:

final Email email = Email(
                      body: "Body",
                      subject: 'Subject',
                      recipients: [],
                      attachmentPaths: [path1],
                      isHTML: false,
                    );

The variable path1 is /data/user/0/com.example.project_name/app_flutter/uploads/upload.pdf. I can confirm that the file exists, since I am reading in on other places as well.

The error I receive is:

java.lang.IllegalArgumentException: Failed to find configured root that contains /data/user/0/com.example.project_name/app_flutter/uploads/upload.pdf
E/MethodChannel#flutter_email_sender( 4008): 	at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
E/MethodChannel#flutter_email_sender( 4008): 	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
E/MethodChannel#flutter_email_sender( 4008): 	at com.sidlatau.flutteremailsender.FlutterEmailSenderPlugin.sendEmail(FlutterEmailSenderPlugin.kt:102)
E/MethodChannel#flutter_email_sender( 4008): 	at com.sidlatau.flutteremailsender.FlutterEmailSenderPlugin.onMethodCall(FlutterEmailSenderPlugin.kt:41)
E/MethodChannel#flutter_email_sender( 4008): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#flutter_email_sender( 4008): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter_email_sender( 4008): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
@ronaldmaymone
Copy link

this #10 may work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant