Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. String[] TO = {"brunoeleodoro96@gmail.com"};
  2. Intent emailIntent = new Intent(Intent.ACTION_SEND);
  3. emailIntent.setData(Uri.parse("mailto:"));
  4. emailIntent.setType("text/plain");
  5. emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
  6. emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Fatec - Americana Mensagem");
  7. emailIntent.putExtra(Intent.EXTRA_TEXT, "Mensagem: " +
  8. "\r\n");
  9.  
  10. try {
  11. startActivity(Intent.createChooser(emailIntent, "Send mail..."));
  12.  
  13. //Log.i("Finished sending email...", "");
  14. } catch (android.content.ActivityNotFoundException ex) {
  15. //Toast.makeText(MainActivity.this,
  16. //"There is no email client installed.", Toast.LENGTH_SHORT).show();
  17. }
  18. dialogInterface.dismiss();
  19. }
  20. });
  21. dialog.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement