How to make a form on android and send the data to an email?

Hello I am creating an android app and I want to create a contact form that was sent to my mail I would like to be helped I am new to this. thank you very much

 2
Author: user13915, 2016-09-05

1 answers

This is a way to send:

 Log.i("Send email", "");
  String[] TO = {"[email protected]"};
  String[] CC = {"[email protected]"};
  Intent emailIntent = new Intent(Intent.ACTION_SEND);

  emailIntent.setData(Uri.parse("mailto:"));
  emailIntent.setType("text/plain");
  emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
  emailIntent.putExtra(Intent.EXTRA_CC, CC);
  emailIntent.putExtra(Intent.EXTRA_SUBJECT, "encabezado");
  emailIntent.putExtra(Intent.EXTRA_TEXT, "[email protected]");

  try {
     startActivity(Intent.createChooser(emailIntent, "Enviando Email..."));
     Log.i("termina envio de email...", "");
  }
  catch (android.content.ActivityNotFoundException ex) {
     Toast.makeText(MainActivity.this, "No existe cliente Email instalado.", Toast.LENGTH_SHORT).show();
  }

For your form, you can create a view with multiple Edittexts to which you write the necessary values.

enter the description of the image here

Here is an example in English:

Http://www.maestrosdelweb.com/curso-android-enviar-emails /

 2
Author: Jorgesys, 2016-09-05 20:48:53