title: Avoid opening Email client when send email Android
body: <p>I have an ordinary code to send text email via Intent, using the emulator.
  The problem I have is that the 'Compose' activity of the Email client - I use an ICS AVD - comes-up when the startActivity() is executed. All the fields are correctly filled-in and I must click on 'Send' to wrap-up the process. After that, the control goes back to my application UI and the email is correctly delivered to destination.
  What should I do to have done the sending smoothly in the background, without popping-up the emulator's Email application?
  Here is my code:</p>
  
  <pre><code>public class AppPilot extends Application {
      ...
      private static Context context;
      ...
      @Override
      public void onCreate() {
          super.onCreate();
          context = this;
      }
      ....
          /**
       * Send an Email 
       * @param emailAddress
       * @param emailObject
       * @param emailBody
       */
      public static void sendEmailCoupon(String emailAddress, String emailSubject,
          String  emailBody)  {
  
          String emailadd[] = { emailAddress };
          Intent emailIntent = new Intent(Intent.ACTION_SEND);
          emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          emailIntent.putExtra(Intent.EXTRA_EMAIL, emailadd);
          emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
          emailIntent.setType("plain/text");
          emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody);
          context.startActivity(emailIntent);
  }
  </code></pre>