I want to attach a text file and email it automatically in background to a predefined email address when button is pressed.
I am creating a text file like this:
   try {
    FileOutputStream fos = openFileOutput("abc.txt",MODE_PRIVATE);
    String s = "Data to be written ok fine cool";fos.write(s.getBytes());
   } catch (Exception e) {
e.printStackTrace();
}
How will I setup the sending of email automatically?
 
     
     
     
     
    