Question

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???

Was it helpful?

Solution

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:"));

OTHER TIPS

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);

        }

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]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top