Adding body to email on Android

I developed an email sending function in my application where I need to send an email with the specified subject. I did it, but I need it as soon as I click the email icon. It defines a specific piece of information in the body part in the e-mail format. It can be any information that I have with me.

Is it possible to set the data in the Email Body in Android, I donโ€™t want to write anything in the body of the email.

Thanks DavidBrown

+4
source share
4 answers
final Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND); emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { " abc@gmail.com " }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Email Subject"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Email Body"); startActivity(Intent.createChooser( emailIntent, "Send mail...")); 

Intent.EXTRA_TEXT is what you are looking for.

+15
source

It is not clear what exactly you want. But if you need to add text / data to the body of the email user

intent.putExtra (Intent.EXTRA_TEXT, "This data will be displayed in the body of the message");

+1
source

try it

 intent.putExtra(Intent.EXTRA_TEXT , "body of email -- add text what you want "); 
0
source

This may be useful for you.

 Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("text/plain"); emailIntent.putExtra(Intent.EXTRA_EMAIL,new String[]{" support@arboristapp.com "}); emailIntent.putExtra(Intent.EXTRA_CC, new String[]{""}); emailIntent.putExtra(Intent.EXTRA_BCC, new String[]{""}); emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject of email"); emailIntent.putExtra(Intent.EXTRA_TEXT, "This is test app"); startActivity(emailIntent); 
0
source

Source: https://habr.com/ru/post/1447402/


All Articles