question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple attachements paths make the body disappear (Android)

See original GitHub issue

Using flutter_email_sender: 4.0.0, I noticed a bug in Android : if I add multiple files path when instanciating an Email object, the body is not taken into account anymore. The Mail app used is GMail.

With the following code, I get an email with the body and one file

final Email email = Email(
      body: 'Here you go, find the files enclosed',
      subject: 'Exporting files',
      recipients: emails,
      attachmentPaths: ['workZip.path'],
      isHTML: false,
    );

With the following code, I get an email with two files but no more body

final Email email = Email(
      body: 'Here you go, find the files enclosed',
      subject: 'Exporting files',
      recipients: emails,
      attachmentPaths: ['workZip.path, info.csv'],
      isHTML: false,
    );

Are you able to reproduce it ? Any ideas on what is happening there ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
t-picommented, Apr 28, 2021

Yes, just ran into the same behavior - thanks for documenting 😃

Single attachment -> everything’s fine

Multiple attachments -> attachments show in the mail, but no body. body is available (print… 🙄) just prior to invoking send.

1reaction
petrblahoscommented, Jun 27, 2021

I tried this small change and it seems to work well both for multiple attachments and for a single one:

https://github.com/petrblahos/flutter_email_sender/commit/4da0b914f9fe45fa98a875ca1c616d2bc5eb66d0

I haven’t tried html body though.

Can somebody comment on why intent.putCharSequenceArrayListExtra was used and not just intent.putExtra?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files in Android Scoped Storage Get Randomly Deleted
I have a navigation-like application in Google Play and I have switched to scoped storage recently. The application needs to download the map ......
Read more >
New features in Android Studio Preview
This page lists the new features introduced in Android Studio preview releases. The preview builds provide early access to the latest features and ......
Read more >
How to find all of your downloads on an Android device
Your downloads on Android devices are stored in the Downloads folder in the My Files or File Manager app. Here's how to access...
Read more >
ClassCastException warning in log when opening e-mail app ...
Just one string for the body, even though we're sending multiple files. intent.putExtra(Intent.EXTRA_TEXT, body);
Read more >
Content-Disposition - HTTP - MDN Web Docs
In a multipart/form-data body, the HTTP Content-Disposition general ... When dealing with multiple files in the same field (for example, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found