I tried to use this code to send email in an android app but I got this error
no apps can perform this action
code.java
private void send()
{
final String subject2 = subject.getText().toString().trim();
final String message2 = message.getText().toString().trim();
final String from2 = from.getText().toString().trim();
String[] TO = {"recipientadress@gmail.com"};
Uri uri = Uri.parse("mailto:"+from2)
.buildUpon()
.appendQueryParameter("subject", subject2)
.appendQueryParameter("body", message2)
.build();
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
Can you help me please thanks in advance