I am trying to open up Gmail Compose screen when a button is clicked in my Android App. Do I need some API key for this from Google? or what do I need to do in my button onC
Intent intent = new Intent(Intent.ACTION_SEND);
String[] recipients = {"recipient@gmail.com"};//Add multiple recipients here
intent.putExtra(Intent.EXTRA_EMAIL, recipients);
intent.putExtra(Intent.EXTRA_SUBJECT, "Mail Subject"); //Add Mail Subject
intent.putExtra(Intent.EXTRA_TEXT, "Enter your mail body here...");//Add mail body
intent.putExtra(Intent.EXTRA_CC, "mailcc@gmail.com");//Add CC emailid's if any
intent.putExtra(Intent.EXTRA_BCC, "mailbcc@gmail.com");//Add BCC email id if any
intent.setType("text/html");
intent.setPackage("com.google.android.gm");//Added Gmail Package to forcefully open Gmail App
startActivity(Intent.createChooser(intent, "Send mail"));