How To Send Email In Android Studio

In this Android Studio article iam going to show you How To Send Email In Android Studio . so  for good explanation you can watch the video for this article at the end . 

 

 

 

Also you can read more android development articles

1: Android Development Articles

 

 

 

Also you can check Python GUI Development Tutorials in the below link.

1: PyQt5 GUI Development Tutorials

2: TKinter GUI Development Tutorials

3: Pyside2 GUI Development Tutorials 

4: Kivy GUI Development Tutorials

5: wxPython GUI Development Tutorials 

 

 

 

1: First of all create a new project in your Android Studio, and choose Empty Activity

also iam using API 20 for this project.

 

 

 

 

2: After that you need to open your main_activity.xml and add a Button in your xml layout

file like this.

 

 

 

 

 

So now open your MainActivity.java file, first you need to make reference for your Button

and after that set onClickListener for your button. also we need to create a sendMail() method.

 

You can see in the sendEmail() method, first of all we have created two strings for storing our to and also cc email addresses. we are going to send email using intent object, so an Intent is a simple message object that is used to communicate between android components such as activities, content providers, broadcast receivers and services. Intents are also used to transfer data between activities. Intents are used generally for starting a new activity using startActivity(). so first of all you need to create the object of the intent and for the action we need to use ACTION_SEND.

 

 

 

 

 

 

Also you can watch the complete video for How To Send Email In Android Studio

 

1 thought on “How To Send Email In Android Studio”

  1. This line:
    String[] to = {“parwizforogh@gmail.com”};

    I thought it will be automatically insert into the email program ??
    But the user has to put in the email of the receiver ??

    greetings
    Bernhard

Comments are closed.

Share via
Copy link
Powered by Social Snap