Top Ad unit 728 × 90

Android Send Email in Android Studio

In this post we will create an Android Email App.
We will not use the default Android Email Client to send emails instead we will use Javamail API to create our own email sender. And you can also use this App for Email.
So if you are searching Best Email App for Android then try the app created by yourself 😉
Before going through the tutorial you can check the following video to see exactly what you will be creating in this tutorial.

Download Javamail API for Android

  • For this Android Email App we will use Javamail API, so before starting our android project download Javamail API from link given below
  • You will get a zip file from the above link. Extract the zip and you will get three .jar files. We will use these .jar files in our android email app project.

Creating Android Email App in Android Studio

  • Open Android Studio and create a new android project.
  • First we will add the downloaded .jar’s to our project.
  • From the left panel click on Android -> Project (see the image below)
  • Now you will get the libs folder inside projectfolder -> app -> libs . Paste all the three .jar files which you have downloaded above inside the libs folder. (See the image below)
javamail api
javamail api
  • Now go to file -> project structure.
project structure
project structure
  • Now go to dependencies and from the right click on the green + sign and then click on file dependencies.
file dependencies
file dependencies
  • Now go to libs folder and add all the three .jar files (you can see in the image)
adding jar android studio
adding jar android studio
  • Now click on ok, ok and you have added the apis to your project.
  • Now come to activity_main.xml and create the following layout.
android email app
android email app
  • Use the following code for creating the above layout.
  • For this android email app we will use gmail to send emails. So create a new java class named and write the following code.
  • You have to write your gmail username and password.
  • Now create a new class It will send our email. Write the following code in this class.
  • Now come to and write the following code.
  • Finally add internet permission to manifest.
  • Thats it now run your application.
android email app
android email app
Android Send Email in Android Studio Reviewed by Jacky on October 04, 2017 Rating: 5

No comments:

All Rights Reserved by JackyLe © 2018 © 2017
Edit bởi: Jacky Le | Youtube Channel: JACKY LE

Send email form


Email *

Message *

Powered by Blogger.