Sending Email from Android via Java Code is not very complex if you configure the Email perfectly in your emulator or device. Keeping that in mind I will give you the code snippet below for sending E-mail:
1. Just create a button in the XML layout file and then paste the code below in your Activity class:
1. Just create a button in the XML layout file and then paste the code below in your Activity class:
// Comment public void chooseEmail(View button) { Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("plain/text"); startActivity(Intent.createChooser(emailIntent, getResources().getString(R.string.chooser))); }
Thanks for the code snippet Mohammad, was really useful.. Even this http://www.compiletimeerror.com/2013/07/send-email-in-android-example.html might help, have a look..
ReplyDelete