3

I am making an app in which i have to take feed back in edit text and send this feed back to a hard code email address. the user just enter his feed back and press button and then email will be sent to id. .. write now in my app instead of sending automatically an email ,user directed towards email page ..
kindly help me :)

public void onClick(View arg0) {
            // TODO Auto-generated method stub

             Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
                String[] recipients = new String[]{"email@example.com", "",};
                emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
                emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");
                emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");
                emailIntent.setType("text/plain");
                startActivity(Intent.createChooser(emailIntent, "Send mail..."));
                finish();

        }
    });
ShaneC
  • 2,376
  • 4
  • 19
  • 27
Abubakar
  • 1,022
  • 10
  • 20

2 Answers2

3

Firstly use Mail.jar, activation.jar, Additional.jar file Upload in Your project

Use this Mail Class.. follow this Question there has provide answer how to send mail without intent in android

Send email in android using JavaMail API with smtp but without SSL

enjoy!

Community
  • 1
  • 1
Akash Singh
  • 5,171
  • 2
  • 26
  • 55
1

I belive this is solved HERE for Gmail. I didn't tested THIS but might be quite good library for all hosts. Don't forget to make it inside AsyncTask ;)

Community
  • 1
  • 1
Y.A.P.
  • 528
  • 4
  • 12