2016-05-09 3 views
0

ich eine Tabelle an eine bestimmte E-Mail-ID per E-Mail senden möchten, und ich möchte die Daten von phpmysql als TabellenformatAndroid - Wie man eine Tabelle in E-Mail senden

ich immer über jede Idee bin nicht abrufen Tabelle an Mail senden. Ich habe diese Links bereits versucht, bitte können Sie einige andere Links senden:

  • Android - Wie den Text als Tabelle

    in E-Mail-Körper der E-Mail-Client zu forma
  • einbetten html table-Tag in E-Mail Absicht android - Stapelüberlauf

  • Wie hTML-Tabelle in E-Mail in android-Anwendung senden - Stapelüberlauf

  • senden html E-Mail in android verwenden, usw. - ist es wirklich kein relativ bu ilt-in Absicht?

+0

Pleas schauen durch aktuelle Antwort senden. Es wird dir helfen http://StackOverflow.com/a/11448730/2685996 – xAqweRx

+0

Danke ... Wie senden Sie das Tabellenformat ??? – user123

+0

Verwenden Sie das HTML-Tabellenformat. Art

Blick Trog http://www.tutorialspoint.com/html/html_tables.htm – xAqweRx

Antwort

0

versuchen Code unten aus: Hinweis: Sie können nur html als Anlage (nicht als E-Mail-Inhalt)

private void shareFile(String subject,String body,String fileContent) { 
    Intent share = new Intent(android.content.Intent.ACTION_SEND); 
    share.setType("text/html"); 
    share.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT); 

    // Add data to the intent, the receiving app will decide 
    // what to do with it. 
    File tempFile ; 
    try { 
     File sdCard = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); 
     File tempDir = new File (sdCard.getAbsolutePath() + "/temp-sample"); 

     AppWebViewClient.deleteDirectoryFiles(tempDir); //delete temp files 
     tempDir.mkdirs(); 
     tempFile = File.createTempFile("sample-records", ".html", tempDir); 
     FileOutputStream fout = new FileOutputStream(tempFile); 
     tempDir.setReadable(true, false); 
     tempFile.setReadable(true, false); 
     Uri uri = Uri.fromFile(tempFile.getAbsoluteFile()); 
     share.putExtra(Intent.EXTRA_STREAM, uri); 
     fout.write(fileContent.getBytes()); 
     fout.close(); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    }  
    share.putExtra(Intent.EXTRA_SUBJECT, subject); 
    share.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(new StringBuilder().append(body).toString())); 
    // share.putExtra(Intent.EXTRA_TEXT, body); 

    context.startActivity(Intent.createChooser(share, "Share Records!")); 
} 
+0

Es ist irgendwie verkabelt. und ist nicht wahr. http://stackoverflow.com/a/11448730/2685996 – xAqweRx

Verwandte Themen