Android app always defaults to Gmail for email intents

I’m having trouble with my Android app. When I try to let users send emails, it always opens Gmail. I want it to show other email options too. Here’s what I’ve tried:

String message = "Hello there";

Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse("mailto:"));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Check out this cool app");
emailIntent.putExtra(Intent.EXTRA_TEXT, message);
startActivity(Intent.createChooser(emailIntent, "Choose email app"));

Even when I remove Gmail accounts and add others like Outlook, it still picks Gmail. How can I make it show all email apps for the user to choose from? Any ideas would be great. Thanks!

yo, i had the same issue! try using ACTION_SEND instead of ACTION_SENDTO. it worked for me. also, make sure ur not setting any gmail-specific extras. if that dont help, maybe clear app defaults in ur phone settings? good luck man!

I encountered a similar issue in one of my projects. The problem might be with the URI scheme you’re using. Instead of ‘mailto:’, try removing it altogether. Here’s what worked for me:

Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType(“text/plain”);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, “Check out this cool app”);
emailIntent.putExtra(Intent.EXTRA_TEXT, message);

startActivity(Intent.createChooser(emailIntent, “Choose email app”));

This approach should prompt the user with all available email clients. If it still doesn’t work, check if you have any intent filters in your manifest that might be interfering with the chooser dialog.

I’ve dealt with this exact problem before, and it can be frustrating. One thing that worked for me was using ACTION_SEND_MULTIPLE instead of ACTION_SENDTO or ACTION_SEND. This seems to bypass some of the default app settings on certain devices.

Here’s a snippet that might help:

Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType(“message/rfc822”);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, “Check out this cool app”);
emailIntent.putExtra(Intent.EXTRA_TEXT, message);

startActivity(Intent.createChooser(emailIntent, “Choose email app”));

Also, make sure you’re not accidentally setting any Gmail-specific flags in your app’s manifest. Sometimes these can interfere with the chooser dialog. If all else fails, you might need to dig into the device’s default app settings, as this can sometimes override your intent’s behavior.