-3

I am new to android. I want to send mail from my application . I want to use two fields email address & text. can u help me ?

Hrishik
  • 167
  • 2
  • 2
  • 7

2 Answers2

1

It's very simple to do it:

final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{address});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, emailtext);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

And don't forget to add this to your manifest file:

<uses-permission android:name="android.permission.INTERNET" />
Tiago Babo
  • 1,064
  • 1
  • 7
  • 9
1

checkout this : sending email programatically using default user account

and this :

http://www.helloandroid.com/tutorials/how-send-email-your-application

for more details.

Community
  • 1
  • 1
Dinesh Sharma
  • 11,533
  • 7
  • 42
  • 60