title: How to send email and get confirmation in Android
body: <p>I am trying to send email through intent, and I want to call the API or web service after mail is successfully sent. How can I do that?</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);
  Uri data = Uri.parse("mailto:?subject=" + emailSubject
          + "&amp;body=" + genericText + " " + genericLink);
  intent.setData(data);
  startActivityForResult(intent, MAIL_CODE);  
  
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if(resultCode == RESULT_OK) {
          // do some task
      }
  }
  </code></pre>