4

How does one send a simple email message, in code, on Android?

0

3 Answers 3

15
Intent sendIntent; sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Test Subject"); sendIntent.putExtra(Intent.EXTRA_TEXT, "Test Text"); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + fileName)); sendIntent.setType("image/jpeg"); startActivity(Intent.createChooser(sendIntent, "Send Mail")); 
Sign up to request clarification or add additional context in comments.

1 Comment

It needs : sendIntent.setType("message/rfc822");
4

Check out the code at anddev.org for how to do it using intents.

1 Comment

Thanx Chris Thompson i posted the code that works fine for me
0

If you don't want to use the User interface for sending mails, check this link: Sending Email in Android using JavaMail API without using the default/built-in app

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.