0

I want to provide email facility in my upcoming android application.Can you please tell me where i should get some good source code examples about how to send email from android application.Thanks in advance.

user1726619
  • 941
  • 2
  • 18
  • 39

2 Answers2

4

K9 mail is an excellent open source, full functional email client for android. It supports POP3, IMAP and Exchange accounts. You'll find everything you need to learn about making an android email app if you study its source. It's hosted on Github here:

https://github.com/k9mail/k-9

Here's the free app on the google play store:

https://play.google.com/store/apps/details?id=com.fsck.k9&hl=en

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
0

If you simply want the user to send a mail to you ,the you can use this code. It uses emailIntent

//letting the user write a email to us
            Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            emailIntent.setType("plain/text");
            emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                    new String[] { "abc@xyz.com" });
            emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
                    "subject of mail");
            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
                    "Insert your mail content");
            MainMenuActivity.this.startActivity(Intent.createChooser(
                    emailIntent, "Send mail..."));
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66