Android mailing office files through the postal client



  • How do we proceed with the dispatch of any data from the programme with a word attached to the letter or excel?



  • Deal the task with the parts and decide it as well.

    1. Set up the file with a format and complete it. In case *.xls Look at this. https://ru.stackoverflow.com/a/391214/17609
    2. And that's how you can start a postal client by sending him an address where to go, the subject of a letter, his text and a bunch of files, which you've done in p.1:

      File[] myAwesomeArrayOfAwesomeFiles = ...;
      

      String to = "К-Л_ОФИГЕННЫЙ_АДРЕС@gmail.com";
      String subj = "я, умею, отправлять, файлы, по, почте";
      String msg = "прикинь, да?! =)))";

      Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
      emailIntent.setType("text/html");
      emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { to });
      emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subj);
      emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, msg);

      ArrayList<Uri> uris = new ArrayList<Uri>();
      for (File f : out)
      {
      uris.add(Uri.fromFile(f));
      }
      emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);

      this.ctx.startActivity(Intent.createChooser(emailIntent, "Send mail..."));




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2