How can I send emails from my Android application? -


I am writing an application for Android. How can I send an e-mail from it?

The best (and easiest) way a intent :

  intent = new intent (int. Action_sand); I.setType ("Message / RFC822"); I.putExtra (Intent.EXTRA_EMAIL, new string [] {"recipient@example.com"}); I.putExtra (Intent.EXTRA_SUBJECT, "Email subject"); I.putExtra (Intent.EXTRA_TEXT, "Body of Email"); Try {startActivity (Intent.createChooser (i, "Send Mail ...")); } Hold (android.content.ActivityNotFoundException ex) {toast.makeText (MyActivity.this, "no email client is installed.", Toast .LENGTH_SHORT) .show (); }  

Otherwise you will have to write your customer.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -