private void sendFeedbackEmail() {
String subject = "[FEEDBACK][" + BuildConfig.VERSION_NAME + "] ";
String bodyText = "Device: " + Build.MANUFACTURER + " - " + Build.MODEL + "\n"
+ "Android: " + Build.VERSION.RELEASE + "\n"
+ "App: " + BuildConfig.VERSION_NAME + "\n"
+ "What did you do and observed: \n\n";
String bodyForGmail = bodyText.replaceAll("(\r\n|\n)", "<br/>");
String mailTo = "mailto:YOUR_EMAIL.com" +
"?subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(bodyForGmail);
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse(mailTo));
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, bodyText);
try {
Intent chooserIntent = Intent.createChooser(emailIntent, "Send email using...");
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(chooserIntent);
}
catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(context, "No email clients installed.", Toast.LENGTH_SHORT).show();
}
}