Android Tutorial 64 - Sending Emails

Published: 25 March 2014
on channel: Code Here Now
16,969
45

This is an excerpt from Learn by Doing - Android for Beginners on Udemy.
https://www.udemy.com/learn-by-doing-...

Learn how to send an email using an intent.

Things to Remember
-----------------------------
1. Intent action to be used is Intent.ACTION_SEND.

2. Set the type by calling the Intent.setType(String) method to set the MIME type, which is message/rfc822.

3. For specifying the recipients' email addresses use a String[] containing an array of email IDs for the extra Intent.EXTRA_EMAIL.

4. Use the Intent.EXTRA_SUBJECT to mention the subject of your email.

5. The Intent.EXTRA_TEXT extra allows you to include the email body.

6. You can use the Intent.EXTRA_CC and Intent.EXTRA_BCC to specify the list of email addresses for recipients who you want to CC or BCC the email.

7. Wrap your Context.startActivity(Intent) call inside a try... catch block to avoid exceptions on devices that do not have an email client.


Watch video Android Tutorial 64 - Sending Emails online without registration, duration hours minute second in high quality. This video was added by user Code Here Now 25 March 2014, don't forget to share it with your friends and acquaintances, it has been viewed on our site 16,969 once and liked it 45 people.