I want to send E-Mails via
Intent i = new Intent(Intent.ACTION_SEND);
without showing a createChooser View. The programm should automatically choose the right E-Mailapp and -account by only given the E-Mailaddress of the Mailaccount to send the mail from.
For example:
My phone got one gmail and two-imap accounts (used via stock email app):
- Gmail: foo@gmail.com
- IMAP-Account: bar@barbar.com
- IMAP-Account: tar@tartar.com
Now I got a view in my app showing “bar@barbar.com” for example. If I click on it, I want to open the compose-dialog of the IMAP-Account(2.). If I click on “tar@tartar.com” the commpose-dialog for IMAP-Account(3.), ans so on… without the user to choose it in a Chooser for E-Mail apps.
This is not possible.
First, users have the freedom to use whatever mail clients they want. There is no way for you to determine what mail client, if any, handles a given mail account, let alone somehow magically enter that particular app.
Second, I am unaware of any mail clients that have dedicated, documented, and supported APIs for you to send mail specifically through them. Certainly, neither of the two email apps you cited (Gmail and “stock email app”) do.