I want to include feedback in my app..so I need to show a popup to send mail and..I need to enter my mail id and feedback and when I am clicking the send button in the popup,the mail must send to the predefined mail id..how it is possible???
Asked
Active
Viewed 4,435 times
4 Answers
7
This is how you implement feedback in android :
Intent feedbackEmail = new Intent(Intent.ACTION_SEND);
feedbackEmail.setType("text/email");
feedbackEmail.putExtra(Intent.EXTRA_EMAIL, new String[] {"yourfeedbackreceiveemailid"});
feedbackEmail.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
startActivity(Intent.createChooser(feedbackEmail, "Send Feedback:"));
Dhruv Jindal
- 1,036
- 10
- 17
-
@ptm if you got your answer, please vote my answer up. – Dhruv Jindal Jan 14 '14 at 13:59
2
It sounds like you're looking for an email intent. Here are a few links to help you!
Community
- 1
- 1
Jonathan N
- 53
- 6
1
The following works fine for me.
public static void writeReviewMail(Context context) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "youremail@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.yoursubject));
context.startActivity(Intent.createChooser(emailIntent, context.getString(R.string.contact_us)));
}
It let's the user choose his e-mail app and insert the addressee aswell as a subject to the email. It may be possible that this does not work in the emulator but it work's for all real devices I've tested so far. [2.1 - 4.4]
Endzeit
- 3,743
- 4
- 27
- 47
-
This is what I do too. It does not work in the emulator, because it lacks email apps to select from. – Rick Falck Jan 14 '14 at 08:54
1
This code actually works.Place this code on a button click(feedback)
private void sendEmail() {
File photo = new File("sdcard/Video Tell Images/" + ViewVideo.saved_image_name);
Uri imageuri = Uri.fromFile(photo);
Intent send_report = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "youremail@example.com", null));
send_report.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
send_report.putExtra(Intent.EXTRA_TEXT, "View my image");
send_report.setType("text/plain");
startActivity(send_report);
}
Pihu
- 1,033
- 11
- 33