Search code examples
androidemailgmail

Pre-populated recipient in Android email?


I am making an application where the user will click on contact us section and it will open the built-in Gmail application and I have the code to pre-populate the subject and message body in the mail.

I want the code to pre-populate the "To: " section where we add the recipient.


Solution

  • In the intent you use to populate the subject and message, add the following:

    intent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[] { "[email protected]" });
    

    Check the documentation for EXTRA_EMAIL