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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -