0

I am making an app in which I have to send email. For this i had implemented code in my app which is working fine but when i try to send email it will prompt me a dialog which gives me option to choose. This chooser i don't want . I simply want when user click button it will send email to user email Id. Is there any mechanism that app send email without user prompt. How can i archive this problem.

code:-

Intent emailapp = new Intent(Intent.ACTION_SEND);
                        emailapp.setType(getString(R.string.text_plain));
                        emailapp.setPackage(getString(R.string.google_gm));
                        emailapp.putExtra(Intent.EXTRA_TEXT, sz_Email);
                        startActivity(emailapp);
Raghav
  • 65
  • 1
  • 12

1 Answers1

0

You can use JavaMail API to handle your email tasks. JavaMail API is available in JavaEE package and its jar is available for download. Sadly it cannot be used directly in an Android application since it uses AWT components which are completely incompatible in Android.

You can find the Android port for JavaMail at the following location: http://code.google.com/p/javamail-android/

Add the jars to your application and use the SMTP method

Rissmon Suresh
  • 13,173
  • 5
  • 29
  • 38