No application can complete this action when sending an email

Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, text.getText()); sendIntent.setType("message/rfc822"); startActivity(Intent.createChooser(sendIntent, "Send email with")); 

that was my code.

I tried sending mail to the emulator. But this shows that no application can perform this action. if someone knows, then tell me

Thank you in advance

+6
source share
6 answers

You need to use text/plain

 intent.setType("text/plain"); 

In addition, Intent.ACTION_SEND is for sharing, you can use Intent.ACTION_SENDTO only to get a list of email clients or to prevent the use of applications such as Facebook, Twitter, etc.

+6
source

Where you want to send mail, it is better to use: Action.SEND_TO :

 Intent sendIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto: sample@mail.com ")); sendIntent.putExtra(Intent.EXTRA_TEXT, text.getText()); 

This will shorten the search list.

NOTE Make sure you create an email account on the emulator, otherwise the email application will not be on the list of handlers and you will get an exception.

+2
source

It worked for me

 Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_EMAIL, new String[]{" youremail@yahoo.com "}); email.putExtra(Intent.EXTRA_SUBJECT, "subject"); email.putExtra(Intent.EXTRA_TEXT, "message"); email.setType("message/rfc822"); startActivity(Intent.createChooser(email, "Choose an Email client :")); 
+2
source

This usually means that there is currently no installed application that understands the request you are making.

In this case, I would venture to suggest that there is no email application on the emulator? Or it is possible that he was not configured.

0
source

After you try everything as indicated in the comments above, if you did not find your solution, just set the default email in the emulator. This works for me.

0
source

This means that there is no application registered to process such an intention.

Edit: Try setting the intent type to "text / plain"

 emailIntent.setType("text/plain"); 

and / or set EXTRA_EMAIL to set email content

 sendIntent.putExtra(Intent.EXTRA_EMAIL, text.getText()); 
-1
source

Source: https://habr.com/ru/post/982691/


All Articles