I need to use the email feature when the user of my app need to send any feedback to developer. I am going to use the below code. I wonder if this needs any permission setup in Manifest file.
Please advice, If this needs any permission that has to be setup in Manifest file
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"[email protected]"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MyActivity.this, "There are no email clients installed.",Toast.LENGTH_SHORT).show();
}
I checked and no, you don't need any permissions setup in AndroidManifest.xml
to send email.
your code does not need any permission for sending email but if you want to send email using libraries like mail.jar
you must add Internet permission to the manifest file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With