Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. setting the sender of an email using startActivity(mailIntent)
  2. Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
  3.             emailIntent.setType("plain/text");
  4.             emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"recipient"+"@email.com"});
  5.             emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
  6.             emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
  7.             startActivity(Intent.createChooser(emailIntent, "Send mail..."));
  8.        
  9. emailIntent.putExtra(android.content.Intent.EXTRA_SENDERS_MAIL_ADDRESS, "My_email_address@email.com");
  10.        
  11. emailIntent.putExtra(android.content.Intent.EXTRA_USERS_EMAIL_ACCOUNT, "mail_account_x");